現時点では私のopensslのバージョンはのOpenSSL:SSL_CTX_set_ecdh_auto()の戻り失敗
のOpenSSL 1.0.2h 3である2016年5月
私は、サーバーを起動して送信するためにs_clientを使用するopensslのSimple_TLS_Serverによって提供されるサンプルコードを使用しますtlsハンドシェイク。サーバは、このようなエラーを返しました:
139629255337616:error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher:s3_srvr.c:1349
そしてs_clientが返さ:私は再起動すると
if(!SSL_CTX_set_ecdh_auto(ctx, 1))
{
fprintf(stderr, "Error: SSL_CTX_set_ecdh_auto(ctx, 1)\n");
}
:
CONNECTED(00000003)
140266915485328:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:769:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 307 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
Key-Arg : None
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1471879558
Timeout : 300 (sec)
Verify return code: 0 (ok)
---
このManual:SSL_CTX_set1_curves(3)を読んだ後、私は元のいくつかの行を修正しましたSimple_TLS_Server、それは印刷します
Error: SSL_CTX_set_ecdh_auto(ctx, 1)
はまた、このように試してみました:
if(!SSL_CTX_set_ecdh_auto(ctx, 1))
{
ERR_print_errors_fp(stderr);
}
しかし、使用可能なエラーメッセージはありませんでした。 これはどのように起こる可能性がありますか?より多くの情報が必要な場合は、私に知らせてください。
PS:s_serverとs_clientで証明書と鍵を試しましたが、うまくいきました。
* "...私のopensslバージョンはOpenSSL 1.0.2hです.2016年5月3日" * - あなたは確信していますか?あなたのサーバに対して 'ldd'を実行し、どのバージョンのOpenSSLがランタイムリンク/ロードであるかを確認してください。あなたが思っているものではないなら、(1)あなたのサーバを '-Wl、-rpath =/usr/local/ssl/lib'でビルドします。または(2) 'LD_LIBRARY_PATH =/usr/local/ssl/lib'でサーバを起動してください。 – jww
@jww、ありがとうございました。私はサーバをOpenSSLライブラリの古いバージョンにリンクしました。今度は 'gcc -o test test.c -L/usr/local/ssl/lib/-I/usr/local/ssl/include -lssl -lcrypto -ldl'でサーバを再構築します。サーバーは今正常に動作します。 – eloy