[英]enable the SSL on localhost not working on custom ports
我試圖在添加的自定義端口8040(localhost:8040)上啟用SSL,我按照一個視頻教程進行了此操作
我已經使用xampp,並在xampp\\apache\\bin
目錄中執行了以下命令
這是三個命令
openssl genrsa -aes256 -out private.key 2048
openssl rsa -in private.key -out private.key
openssl req -new -x509 -nodes -sha1 -key private.key
-out certificate.crt -days 36500 -config C:\xampp\apache\conf\openssl.cnf
現在,我復制了生成的文件private.key
和certificate.crt
並將它們粘貼到此目錄C:\\xampp\\apache\\conf\\key
。
我取消了與httpd.conf
文件中與SSL相關的行的注釋
和C:\\xampp\\apache\\conf\\extra
內部的文件httpd-ssl.conf
我添加了一個新目錄
<VirtualHost *:8040>
DocumentRoot "C:/xampp/htdocs/laravel/public"
ServerName qa-staging.com
ServerAdmin admin@example
ErrorLog "C:/xampp/apache/logs/error.log"
TransferLog "C:/xampp/apache/logs/access.log"
SSLEngine on
SSLCertificateFile "C:/xampp/apache/conf/key/certificate.crt"
SSLCertificateKeyFile "C:/xampp/apache/conf/key/private.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/xampp/apache/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "C:/xampp/apache/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
但是當我嘗試打開https:\\\\localhost:8040
該網站無法提供安全的連接
現在,如果我將密鑰和證書目錄添加到默認端口443
當我請求https:\\ localhost時,它工作正常
嘗試在httpd.conf中添加“偵聽8040”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.