httpでアプリケーションを実行していて、httpsからログインページを作成しようとしました。以前のApacheWebサーバーは、ajpプロトコルを介して登録済みワーカーであるTomcatにリクエストを転送するために使用されていました。ここで、キーと証明書を/etc/apache2/crt、、つまりssl.key、に追加しましたssl.crt。その中にファイルもありcertificate.csrます。上記の証明書の生成に使用されるコマンドは、http://www.akadia.com/services/ssh_test_certificate.htmlからのものです。2つの/etc/apache2/sites-availableファイルがあるため、手順6は実行していません。私は2行を変更しました:defaultdefault-ssldefault-ssl
SSLCertificateFile /etc/apache2/crt/certificate.csr
SSLCertificateKeyFile /etc/apache2/crt/ssl.key
server.xmlまた、ポスト8446でhttpsを受信するようにTomcatを変更しました。
<Connector port="8446" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="/etc/apache2/crt/ssl"
keystorePass="password"/>
私も変更web.xmlしましたが、さらに次のものが含まれています。
<security-constraint>
<web-resource-collection>
<web-resource-name>Secure Login</web-resource-name>
<url-pattern>/login/*</url-pattern>
<!-- <url-pattern>/other/secure/stuff/*</url-pattern> -->
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
試しcurl -Iv https://localhostましcurl -Iv https://localhost:8446たが、次のエラーが発生します。
About to connect() to localhost port 8446 (#0)
* Trying 127.0.0.1... Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
これを実現する方法を教えてください。