[prev in list] [next in list] [prev in thread] [next in thread]
List: openssl-users
Subject: Re: problem with my code
From: Viktor Dukhovni <openssl-users () dukhovni ! org>
Date: 2020-06-18 17:50:26
Message-ID: 20200618175026.GS36399 () straasha ! imrryr ! org
[Download RAW message or body]
On Thu, Jun 18, 2020 at 12:00:33PM +0200, Attila Csosz wrote:
> err = connect(sd, (struct sockaddr*) &sa, sizeof(sa));
>
> // Create SSL context
> meth = SSLv23_server_method();
Have you tried SSLv23_client_method()? Your application is a TLS
client, not a TLS server...
> if (!meth) throw Exception("SSL: method");
> ctx = SSL_CTX_new(meth);
> if (!meth) throw Exception("SSL: context");
> ssl = SSL_new(ctx);
> if (!ssl) throw Exception("SSL: ssl");
> SSL_set_fd(ssl, sd);
>
> // Connect
> err = SSL_connect(ssl);
> if (err == -1) throw Exception("SSL: SSL_connect");
--
Viktor.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic