サーバーが証明書を提示しているかどうかを確認する OpenSSL コマンド 質問する

サーバーが証明書を提示しているかどうかを確認する OpenSSL コマンド 質問する

システムから送信メッセージを送信する際に SSL の問題が何であるかを絞り込むために、openssl コマンドを実行しようとしています。

別のトピックでこのコマンドを見つけました:opensslを使用してサーバーから証明書を取得する

openssl s_client -connect ip:port -prexit

この出力は

CONNECTED(00000003)
15841:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 121 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

これは、サーバーが証明書を提示していないことを意味しますか? 別の IP:ポートで他のシステムを試したところ、証明書が正常に提示されました。

相互認証は -prexit を使用したこのコマンドに影響しますか?

- アップデート -

コマンドを再度実行しました

openssl s_client -connect ip:port -prexit

そして今、私はこの反応を得ました

CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 121 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

コマンドに-ssl3を追加しました

openssl s_client -connect ip:port -prexit -ssl3

応答:

CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : SSLv3
    Cipher    : 0000
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: 
    Key-Arg   : None
    Krb5 Principal: None
    Start Time: 1403907236
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
---

-tls1も試す

CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 0 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : 0000
    Session-ID: 
    Session-ID-ctx: 
    Master-Key: 
    Key-Arg   : None
    Krb5 Principal: None
    Start Time: 1403907267
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
---

ベストアンサー1

私は今日SSLの問題をデバッグしていたのですが、同じwrite:errno=104エラーが発生しました。結局、この動作の原因はサーバーにあることがわかりました。必要なSNI( servernameTLS 拡張) が正しく動作するようにするため、-servernameopenssl にオプションを指定すると、正常に接続できました。

openssl s_client -connect domain.tld:443 -servername domain.tld

おすすめ記事