Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 886
jiayaomin Avatar asked Apr 13 '26 06:04

jiayaomin


1 Answers

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, ...

like image 89
Steffen Ullrich Avatar answered Apr 15 '26 02:04

Steffen Ullrich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!