1. 產生ca.crt、server.p12、server.jks認證檔案
2. 在tomcat conf\server.xml配置
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="D:/apache-tomcat-8.0.35-windows-x64/webapps/ROOT/ca/server.p12" keystorePass="123456" keystoreType="PKCS12" truststoreFile="D:/apache-tomcat-8.0.35-windows-x64/webapps/ROOT/ca/server.jks" truststorePass="123456" truststoreType="JKS"/>
其中keystoreFile是server.p12的路徑,keystorePass是server.p12密碼,預設為==123456==;truststoreFile.jks的路徑,truststorePass是server.p12密碼,預設為==123456==
可以通過https://XXXX:8443測試組態是否成功 3. 把iOS安裝包資源放到伺服器某個目錄下
- aqgk_1.0.ipa是iOS應用安裝包。
- ca.crt是用戶端安裝認證,下載ipa前一定需要先安裝認證。
- icon.png是應用表徵圖。
- index.html是安裝認證和下載安裝包網頁。需要修改2個地址
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>應用程式名稱字</title></head> <body> <h1 style="font-size:40pt">iOS應用OTA安裝<h1/> <h1 style="font-size:40pt"> <a title="iPhone" href="http://192.168.60.242:8080/html/ca.crt">ssl 認證安裝</a> <h1/> <a title="iPhone" href='itms-services://?action=download-manifest&url=https://192.168.60.242:8443/html/p2_local.plist'>to download app</a> <h1/> </body></html>
==這裡要注意,下載路徑要正確。== p2_local.plist是安裝包安裝配置,需要修改ipa下載地址和表徵圖下載地址
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>items</key> <array> <dict> <key>assets</key> <array> <dict> <key>kind</key> <string>software-package</string> <key>url</key> <string>http://192.168.60.242:8080/iOS_download/aqgk_1.0.ipa</string> </dict> <dict> <key>kind</key> <string>display-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>http://192.168.60.242:8080/iOS_download/icon.png</string> </dict> </array> <key>metadata</key> <dict> <key>bundle-identifier</key> <string>cn.com.ut.fdtab1a.mapp</string> <key>bundle-version</key> <string>1.0</string> <key>kind</key> <string>software</string> <key>subtitle</key> <string>App Subtitle</string> <key>title</key> <string>App Title</string> </dict> </dict> </array></dict></plist>