jiayaomin
jiayaomin

Reputation: 33

WHY can I not found "TLSv1_3_client_method()" when programming with openssl?

I'm currently writing a client program on Linux Ubuntu 16.04. I want to use OpenSSL to secure communication. But I get this error when I use gcc to complie my source code:

$gcc -o client1 client.c -lssl -lcrypto

"undefined reference to "TLSv1_3_client method"

image

The version of my OpenSSL is 1.1.1d:

image

How can I solve this ?

Upvotes: 2

Views: 2288

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123320

There is no TLSv1_3_client_method. And even the older TLSv1_2_client_method and similar are documented as deprecated. Instead you should use TLS_client_method which will also support TLS 1.3. If you want to restrict support to only TLS 1.3 you need to use SSL_CTX_set_options and similar with SSL_OP_NO_TLSv1_2, SSL_OP_NO_TLSv1_1, ...

Upvotes: 4

Related Questions