每種web伺服器不太一樣,配置https默認為443埠。需要准備ssl證書。
1、java相關比如tomcat/weblogic等,需要keystore文件包含ssl證書,例如tomcat需要在conf/server.xml配置
<Connector port="443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keystoreFile="keystore.jks" keypass="123456" URIEncoding="UTF-8"/>
2、apache/nginx等需要用key和pem證書,例如nginx
server {
listen 443;
server_name localhost;
ssl on;
ssl_certificate www.pem;
ssl_certificate_key www.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 SSLv2 SSLv3;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+SSlv3:+EXP;
ssl_prefer_server_ciphers on;
location /{
/www;
include proxy.conf;
}
}
3、例如IIS,需要PFX或P12證書,配置https,443埠,指定ssl證書即可
4、netstat -ntlp檢查443埠是否開啟