Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ AFNetworking + Nginx HTTPS communication server +     - How to adjust the system time CentOS (Linux)

- Go performed using iOS and Android programming (Programming)

- CentOS6 installation configuration rsh (Server)

- RedHat Linux 6 desktop installation (Linux)

- Deployment Kubernetes manage Docker example cluster on Ubuntu (Server)

- SSL VPN SSL VPN access to security websites patron (Linux)

- The text formatting tools awk Linux system (Linux)

- Infinispan 8 new Redis cache storage implementation (Linux)

- To use Linux to create a secure managed gateway (Linux)

- Broadcom transplanted to OpenWrt summary (Programming)

- How Bluetooth turned off by default in Ubuntu 14.04 (Linux)

- Gentoo: existing preserved libs problem solving (Linux)

- Linux system file directory structure Introduction (Linux)

- C # how to generate a folder or file automatically rename (Programming)

- RHEL5.8 physical opportunities to Read-only file system (Linux)

- Installation and operation GAMIT software under Linux operating system (Linux)

- xargs Detailed description (Linux)

- Elementary OS Freya global menu (Linux)

- U disk to install Windows and Ubuntu 15.04 dual system (Programming)

- Vim configuration instructions (Linux)

  AFNetworking + Nginx HTTPS communication server +
  Add Date : 2018-11-21      
  Introduction iOS platform with AFNetworking background with HTTPS secure communication interface. 2. Introduction Background self-signed certificate production steps. 3. Linux platform Nginx configuration and protocol HTTPS Web site interface.

This is about HTTPS secure communication AFNetworking problem, many have not had the first experience, and even had a little experience will be uncertain. It is actually very simple:

A. For the back-end server certificate if it is configured for moving through the CA certificate issued by the user to access the back-end interfaces with AFNetworking completely without feeling, and http same way.
B. But a HTTPS certificate if it is well-known CA certificate issued by the agency, then there will be problems, AFNetworking default deny such communication and back-end server, because the verification pass, and everyone 12306 pages open to grab votes, as the certificate after CA is not issued, but the Ministry of Railways a self-signed certificate. So, for start-ups or small and medium sized growth companies, buying a https certificate also it takes a lot of costs. Therefore, we do background communication time is generally a self-signed certificate to implement https interface. Self-signed certificate can use the following openssl command to generate:
openssl req -new -x509 -nodes -days 365 -newkey rsa: 1024 -out tv.diveinedu.com.crt -keyout tv.diveinedu.com.key
Wherein: -days 365 is valid for the length of time specified in the certificate, the unit is days, counting from the time the command is run; -newkey rsa: 1024 is designated newly generated certificate 1024 bit length RSA asymmetric encryption algorithm; -out specified certificate output file name -keyout specify the output file name of the private key of the above command to enter some setup information after the run:

Country Name (2 letter code) [AU]: CN
State or Province Name (full name) [Some-State]: Hunan
Locality Name (eg, city): Changsha
Organization Name (eg, company) [Internet Widgits Pty Ltd]: tv.diveinedu.com
Organizational Unit Name (eg, section): Market
Common Name (e.g. server FQDN or YOUR name): tv.diveinedu.com
Email Address: diveinedu@qq.com
If you are interested to build a Linux background HTTPS service, you need a certificate and private key is generated or uploaded to the server directly on the server, the configuration of the certificate to the backend server to Nginx as an example the following settings:

1. First add a virtual host configuration file Nginx,
sudo touch /etc/nginx/sites-available/tv.diveinedu.com
2. Then make the configuration files take effect:
sudo ln -sf /etc/nginx/sites-available/tv.diveinedu.com /etc/nginx/sites-enabled/tv.diveinedu.com
3. Edit the file:
sudo vim /etc/nginx/sites-enabled/tv.diveinedu.com
4. Knock i enter VIM editing mode, enter this configuration:

server {
    listen 80; #HTTP default port 80
    server_name tv.diveinedu.com; # hostname, HOST match the HTTP request header field
    access_log /var/log/nginx/tv.diveinedu.com.log;# access log path
    return 301 https: // $ server_name $ request_uri; # to force all http access Skip to https

server {
    listen 443; #HTTPS default port 443
    ssl on; # Open SSL Security Socket
    ssl_certificate /etc/nginx/tv.diveinedu.com.crt;# certificate file path
    ssl_certificate_key /etc/nginx/tv.diveinedu.com.key;# private key file path

    server_name tv.diveinedu.com; # hostname, HOST match the HTTP request header field
    access_log /var/log/nginx/tv.diveinedu.com.log;# access log path
    location / {
        root /var/www/tv.diveinedu.com/;# website document root directory
        index index.php index.html; # default home page
5. After knocking ESC VIM exit editing mode, and then hit Enter x in Vim save and exit. Then execute Nginx configuration file syntax checking command to check the configuration is wrong:
nginx -t
If no error is output:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
6. Then you just need to restart the server Nginx
sudo service nginx restart
Then go back to your domain name service provider to resolve your domain name to the server to the IP address can be freely accessed, the browser will only access will be automatically organizes and displays the warning added manually to the trust can be.
- Docker startups use continuous integration deployment (Server)
- Detailed installation of CentOS 6.x (Linux)
- Python programmers most often committed ten errors (Programming)
- Ubuntu 14.04 installed NVIDIA graphics driver (Linux)
- Linux Kernel 4.2.2 compiler installation tutorial (Linux)
- Linux Shell Understanding and Learning (Linux)
- How to use SHA256 checksum files download (Linux)
- Linux account management add relevant directives (Linux)
- Zombie process under Linux (Linux)
- Linux operating system must know the security command (Linux)
- Oracle 12CIN-memory in table spaces (Database)
- Implicit conversion from Java type conversion compare MySQL and Oracle (Database)
- Oracle Linux 7.1 install Oracle 12C RAC (Database)
- Linux (RHEL5) general optimization system security (Linux)
- Linux Command Line Art (Linux)
- Ubuntu install Scala 2.10.x version (Linux)
- IntelliJ IDEA common list of shortcuts (Linux)
- Android imitation UC browser scroll up and down functions (Programming)
- Linux kernel programming parameter passing between modules and function calls (Programming)
- Ubuntu Server 14.04 installation Web server (Linux + Apache + MySQL + PHP) (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.