iOS7.1Https企業認證發布方法

來源:互聯網
上載者:User

標籤:http   io   os   使用   ar   strong   檔案   sp   art   

openssl使用的是macos系統內建的版本,關鍵點是不同直接使用ios裝置開啟https的連結,需要將認證發到系統的mail裡,安裝到裝置,

如果命令執行不成功,用sudo執行。

1.產生伺服器的私密金鑰

openssl genrsa -out server.key 1024

2.產生簽署申請(注意除Common Name以外可以為空白,Common Name必須為伺服器的ip或網域名稱)

openssl req -new -key server.key -out server.csr

3.產生CA私密金鑰

openssl genrsa  -out ca.key 1024 

4.利用CA的私密金鑰產生CA的自簽署認證

openssl req  -new -x509 -days 365 -key ca.key -out ca.crt

5.在目前的目錄建立demoCA,裡面建立檔案index.txt和serial,serial內容為01,index.txt為空白,以及檔案夾newcerts

openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key

將ca.crt檔案通過郵件發送到ios裝置的Mail上,進行認證的安裝

/private/etc/apache2/httpd.conf ,編輯這個檔案去掉下面三行前面的 ‘#‘

LoadModule ssl_module libexec/apache2/mod_ssl.so

Include /private/etc/apache2/extra/httpd-ssl.confInclude/private/etc/apache2/extra/httpd-vhosts.conf

/private/etc/apache2/extra/httpd-ssl.conf,編輯這個檔案去掉下面兩行前面的 ‘#‘

SSLCertificateFile "/private/etc/apache2/ssl/server.crt"

SSLCertificateKeyFile "/private/etc/apache2/ssl/server.key"

/private/etc/apache2/extra/httpd-vhosts.conf ,編輯這個檔案在 ‘NameVirtualHost*:80‘ 後面添加:

NameVirtualHost *:443

在檔案末尾添加:

<VirtualHost *:443>

    SSLEngine on

    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

    SSLCertificateFile /private/etc/apache2/ssl/server.crt

    SSLCertificateKeyFile /private/etc/apache2/ssl/server.key

    ServerName localhost

    DocumentRoot "/Library/WebServer/Documents"

</VirtualHost>

到這裡就配置完了,檢查配置,沒問題的話重啟Apache就好了

sudo apachectl configtest

sudo apachectl restart

iOS7.1Https企業認證發布方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.