Merge pull request 'Fix TLS, again...' (#38) from lda/Cytoplasm:fix-tls into master
Compile Cytoplasm / Compile Cytoplasm (x86, alpine-v3.19) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86, debian-v12.4) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86, freebsd-v14.0) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86, netbsd-v9.3) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86_64, alpine-v3.19) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86_64, debian-v12.4) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86_64, freebsd-v14.0) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86_64, netbsd-v9.3) (push) Waiting to run Details
Compile Cytoplasm / Compile Cytoplasm (x86_64, openbsd-v7.4) (push) Waiting to run Details

Reviewed-on: #38
This commit is contained in:
Jordan Bancino 2024-06-24 14:18:43 -05:00
commit bd310e62ac
1 changed files with 2 additions and 8 deletions

View File

@ -71,14 +71,6 @@ TlsInitClient(int fd, const char *serverName)
OpenSSLCookie *cookie;
char errorStr[256];
/*
* TODO: Seems odd that this isn't needed to make the
* connection... we should figure out how to verify the
* certificate matches the server we think we're
* connecting to.
*/
(void) serverName;
cookie = Malloc(sizeof(OpenSSLCookie));
if (!cookie)
{
@ -89,12 +81,14 @@ TlsInitClient(int fd, const char *serverName)
cookie->method = TLS_client_method();
cookie->ctx = SSL_CTX_new(cookie->method);
coolie->fd = fd;
if (!cookie->ctx)
{
goto error;
}
cookie->ssl = SSL_new(cookie->ctx);
SSL_set_tlsext_host_name(cookie->ssl, serverName);
if (!cookie->ssl)
{
goto error;