


Introduction
In network communications, packet capture software can be used to analyze network requests and perform replay attacks. The solution to replay attacks is generally to use a change Parameters, such as rsa encrypted timestamp, but considering the network transmission delay, the timestamp needs to have a certain error tolerance, which still cannot fundamentally prevent replay attacks. If you want to better solve the problem of replay attacks, you should consider using https communication. The https protocol is a network protocol built from the ssl http protocol that can perform encrypted transmission and identity authentication. It is more secure than the http protocol.
Implementation
For websites accessed with a browser, you need to apply for a certificate from the ca to ensure that https web pages can be browsed normally, otherwise you will be warned that it is unsafe or For uncertified websites, for the transmission of some background data, a self-signed certificate can be used.
Configuration of the server
Generate certificate
Perform the following operations on the server’s command line
① To generate the private key of the server, you need to enter a 4~8191-digit password
openssl genrsa -des3 -out server.key 2048
② To remove the password of the key file, you need to enter the password
openssl rsa -in server.key -out server.key
filled in ① ③ Generate the csr file, This step requires entering a variety of information. You can press Enter to skip them all.
openssl req -new -key server.key -out server.csr
④ Generate a crt file. The -days in this step is followed by the validity period. You can write it longer
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
⑤ Merge Crt and key are used to make pem, which is used to generate cer later for client verification
cat server.crt server.key > server.pem
⑥Use pem to generate cer, and the cer file is stored on the client for verification
openssl x509 -in server.pem -outform der -out server.cer
2. Modify the nginx configuration file
If you don’t know the path to the configuration file, use the following command to print it.
nginx -t
This command can be used to test whether the configuration file is correct and will also print out the path.
According to the printed content, open nginx.conf and you can find that there is an http { ... } configuration tag. Add a server configuration tag to the http tag.
server { listen 443; server_name localhost; # 配置网站的根目录和首页的文件名和类型 index index.html index.htm index.php; root <这里填写网站的根目录> ssl on; ssl_certificate <这里填写crt文件server.crt的全路径> ssl_certificate_key <这里填写私钥key文件server.key的全路径> # 下面是对php的配置,如果不配置,将无法正常解析php文件,这段配置是从nginx对http的80端口配置中复制过来的,如果这段配置不能正常工作,请从自己的服务器对80端口的配置文件中复制过来。 location ~ .*\.(php|php5)?$ { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } # 这里如果不知道如何填写,请参考80端口的配置文件 include <nginx的conf目录路径>/rewrite/default.conf; access_log <nginx服务器日志的路径>/default.log; }
3. Update configuration
nginx -t #测试配置文件是否正确 nginx -s reload #重新加载配置文件
At this point, the server-side configuration is over.
Client configuration
If it is a certificate issued by ca, you can directly use https request, but we are a self-signed certificate, if you access it directly, an error will be reported, as described below Here's how to use afn to configure https requests for self-signed certificates.
1. Import the cer certificate mentioned above into the bundle of the app
Place server.cer Import bundle
2. Before using afn to make a request, perform the following configuration
afsecuritypolicy *policy = [afsecuritypolicy policywithpinningmode:afsslpinningmodepublickey]; policy.allowinvalidcertificates = yes; afhttpsessionmanager *manager = [afhttpsessionmanager manager]; manager.securitypolicy = policy; // 下面使用manager进行https请求即可。
The above is the detailed content of How to configure HTTPS secure communication between Nginx server and iOS. For more information, please follow other related articles on the PHP Chinese website!

iOS16是Apple移动设备的重大更新,因为它不仅引入了新功能,还为iPhone14Pro和ProMax带来了独家功能。这些新款iPhone是Apple首款配备常亮显示屏的iPhone。苹果对AOD的看法略有不同,不是整个屏幕变黑,而是显示变暗,刷新率动态降低到1Hz。不用说,这并不适合世界各地的许多用户和评论者,因为大多数人会不经意地检查他们的手机,并假设这是一条通知而不是AOD。Apple似乎已经在最新版本的iOS16中认识到并纠正了这个问题,增加

您可以在 iOS 16 上选择哪些数字格式随着对 iOS 16.4 (beta 2) 的更改,您可以为您的 iPhone 选择三种不同的数字格式。这些格式使用空格、逗号和句点作为分隔数字中千位的符号或作为小数点。小数点是用于将值的整数部分与其小数部分分开的字符,通常由句点 (.) 或逗号 (,) 分配。千位分隔符用于将多位数的数字分成三组,通常由句点 (.)、逗号 (,) 或空格 ( ) 指定。 在最新版本的 iOS 上,您将能够应用以下任何一种数字格式作为您 iPhone 的首选选项:1,23

虽然不需要的电话是日常生活的一部分,但您的 iPhone 提供了一些不同的选项来使特别顽固的来电者静音。这是在iOS 15上阻止或静音不需要的电话的方法。屏蔽电话号码可以为您减轻很多压力。一旦被阻止,您将不会收到来自被阻止号码的任何呼叫的提醒。此外,呼叫者将被允许留下语音邮件,但您不会收到已留下语音邮件的通知。打开电话应用滚动到您要阻止的号码点击号码旁边的信息图标向下滚动并点按阻止此来电者点击阻止联系人您也可以在FaceTime应用程序中按照相同的步骤来阻止持续的 FaceTime 呼叫者。被屏

浏览互联网已成为我们大多数人的第二天性,我们目前生活在一个时代,它已成为我们所做的几乎所有事情的代名词。它不仅是我们用来购物,或与亲朋好友相聚的地方,它也成为了一种宝贵的工作用具。自从COVID-19大流行开始,混合工作成为新常态以来,浏览器和通信软件已成为我们与同事之间的新纽带。而且,在我们所有流行的浏览器选择中,绝大多数用户决定使用谷歌的Chrome。现在,您不一定需要运行Microsoft支持的操作系统才能使用Chrome,因为该软件也可以在其他软件上正常运行。话虽这么说,如果您尝试在

iOS 16 已经准备好再次推动你放弃实体钱包。对 iOS 16 所做的更改包括一些仅限于美国地区的功能,但苹果也愿意将其部分功能开放给其他平台。首先,马里兰州和亚利桑那州现在支持 Apple 的数字身份验证服务 Wallet ID。除了这两个,Apple 还表示很快还会有另外 11 个,但没有任何关于哪些州的进一步信息。钱包 ID 也可以在 Uber 等应用中使用,并且不必分享您的具体信息。例如,它可以说您已超过 21 岁,但不提供您的实际年龄。Apple Wallet 中的数字密钥也可以通过

微软待办已收到 iOS 更新,将版本升级至 2.75,并添加了一些值得注意的更改。最新版本的任务管理应用程序提供更流畅的体验。这是因为微软在最新版本的应用程序中引入了滚动改进。除此之外,最新版本还可能带有错误修复和改进。您可以在下面阅读完整的官方变更日志。微软待办 2.75 版几个月前,微软更新了它的 To Do iOS 应用程序,让用户更容易为他们的任务添加注释。它旨在为您的

ios不是linux,ios实际上是Darwin的ARM变体,源自BSD,类UNIX内核以及Apple自己的Mach内核扩展系统;这与Linux是完全不同的,Linux是一个单片内核,所有驱动程序代码和I/O工具包都是核心内核的一部分。

苹果公司周二向开发人员发布了iOS 16.2 beta 2,因为该公司准备在 12 月向公众提供更新。正式地,它添加了新的 Freeform 协作应用程序和对 Home 应用程序的改进。在后台,9to5Mac发现 Apple 一直在开发一种新的“自定义辅助功能模式”,该模式将为 iPhone 和 iPad 提供“流线型”体验。自定义辅助功能模式这种代号为“Clarity”的新模式基本上用更精简的模式取代了 Springboard(这是 iOS 的主要界面)。该功能在当前测试版中仍对用户不可用,将


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver Mac version
Visual web development tools