HTTPS certificate Generation method, also applies to the app

Source: Internet
Author: User

Steps:

First, log in to the server, create the ioscert directory

CD ~/servers/app

mkdir Ioscert

Second,CD to ioscert directory, execute the following command:

1.OpenSSL genrsa-out server.key

2.OpenSSL req-new-out server.csr-key server.key

the value of Common Name must be your server IP;OrganizationName Remember to fill in the contents, this value should be with the 4 Step in OrganizationName values are consistent.

3.OpenSSL genrsa-out ca.key

4.OpenSSL req-new-x509-days 365-key ca.key-out ca.crt

Fill in the content and the second step is consistent, where OrganizationName must be consistent with the second step

5 directory, in ca Span style= "FONT-FAMILY:CALIBRI;" >index.txt serial Span style= "Font-family:simsun;" > file and newcerts directory, Span style= "FONT-FAMILY:CALIBRI;" >serial , index.txt empty.

6.OpenSSL ca-in server.csr-out server.crt-cert ca.crt-keyfile ca.key

If the following problem occurs when you perform step 6 (the current system user is not rootedand theoperating permissions are insufficient)

Nvmbd1bji090v01-esapp%openssl ca-in server.csr-out Server.crt-cert ca.crt-keyfile Ca.key

Using Configuration From/etc/pki/tls/openssl.cnf

I am Unable to access the/etc/pki/ca/newcerts directory

/etc/pki/ca/newcerts:permission denied

Workaround:

1. Copy the /etc/pki/tls/openssl.cnf to The path of the CA file to be generated, for example /home/esapp/ servers/app/ioscert/

2. Modify The openssl.cnf file to change the [Ca_default]dir Property to the CA file path CA path, for example /home/esapp/servers/app/ioscert/ca

3. execute commands under the path of the CA file,OpenSSL ca-in server.csr-out server.crt-cert ca.crt-keyfile Ca.key- Config openssl.cnf

7,OpenSSL pkcs12-export-in server.crt-inkey server.key-out server.p12 Password using the password entered above " 123456".

8,java-cp jetty5.1.10.jar org.mortbay.util.PKCS12Import server.p12 server.jks

If an error occurs: The description of your Jetty-5.1.10.jar is not copied to the command line under the current folder.

Third, modify the server.xml file, set port and server.p12,server.jks the path

Add thread management :

<executor name= "Webcontainerthreadpoolapp" nameprefix= "webcontainer-" maxthreads= "" "MinSpareThreads="/> "

Append :

<connector executor= "Webcontainerthreadpoolapp" port= "9999" protocol= " Org.apache.coyote.http11.Http11NioProtocol "connectiontimeout=" 20000 "enablelookups=" false "Backlog=" 2000 " Acceptcount= "4096" server= "Mapp" sslenabled= "true" scheme= "https" secure= "true" usebodyencodingforuri= "true" Maxhttpheadersize= "16384" keystorefile= "/DISK2/APPWEB/SERVERS/APP/IOSCERT/SERVER.P12" keystorePass= "123456" Keystoretype= "PKCS12" clientauth= "false" sslprotocol= "TLS" truststorefile= "/disk2/appweb/servers/app/ioscert/ Server.jks "truststorepass=" 123456 "truststoretype=" JKs "/>

Iv. Installing the ca.crt on the Ipad

E - mail, you can send ca.crt through A email to B email, and then in ipad on Log on B Email , click the attachment in the CA.CRT can be installed

HTTPS certificate Generation method, also applies to the app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.