Compare commits
No commits in common. "bd310e62acfef34735ef50612433ce7ee9f7955a" and "b9dc169917c499e88fd0ecda7f1180f57ed883a2" have entirely different histories.
bd310e62ac
...
b9dc169917
1 changed files with 8 additions and 2 deletions
|
@ -71,6 +71,14 @@ TlsInitClient(int fd, const char *serverName)
|
||||||
OpenSSLCookie *cookie;
|
OpenSSLCookie *cookie;
|
||||||
char errorStr[256];
|
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));
|
cookie = Malloc(sizeof(OpenSSLCookie));
|
||||||
if (!cookie)
|
if (!cookie)
|
||||||
{
|
{
|
||||||
|
@ -81,14 +89,12 @@ TlsInitClient(int fd, const char *serverName)
|
||||||
|
|
||||||
cookie->method = TLS_client_method();
|
cookie->method = TLS_client_method();
|
||||||
cookie->ctx = SSL_CTX_new(cookie->method);
|
cookie->ctx = SSL_CTX_new(cookie->method);
|
||||||
coolie->fd = fd;
|
|
||||||
if (!cookie->ctx)
|
if (!cookie->ctx)
|
||||||
{
|
{
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
cookie->ssl = SSL_new(cookie->ctx);
|
cookie->ssl = SSL_new(cookie->ctx);
|
||||||
SSL_set_tlsext_host_name(cookie->ssl, serverName);
|
|
||||||
if (!cookie->ssl)
|
if (!cookie->ssl)
|
||||||
{
|
{
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in a new issue