From 65aa7d37f8e4b8e4fd15ee26c42a84f2950a40ab Mon Sep 17 00:00:00 2001 From: nishi Date: Sun, 3 Mar 2024 16:33:36 +0000 Subject: [PATCH] fixing sni git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@261 d27a3e52-49c5-7645-884c-6793ebffc270 --- Example/fetch/fetch.c | 2 +- Library/DNS.c | 1 + W3Version.h.m4 | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Example/fetch/fetch.c b/Example/fetch/fetch.c index 8b58f8c..2d0d4c7 100644 --- a/Example/fetch/fetch.c +++ b/Example/fetch/fetch.c @@ -37,7 +37,7 @@ int main(int argc, char** argv) { return 1; } W3_Library_Init(); - struct W3* w3 = W3_Create("http", argv[1], 80); + struct W3* w3 = W3_Create("https", argv[1], 443); if(w3 != NULL) { W3_Set_Read_Size(w3, 1024); W3_Set_Method(w3, argv[3] == NULL ? "GET" : argv[3]); diff --git a/Library/DNS.c b/Library/DNS.c index 8c24b52..9da693d 100644 --- a/Library/DNS.c +++ b/Library/DNS.c @@ -88,6 +88,7 @@ int __W3_DNS_Connect(const char* hostname, bool ssl, uint16_t port *o_ctx = SSL_CTX_new(method); *o_ssl = SSL_new(*o_ctx); SSL_set_fd(*o_ssl, sock); + SSL_set_tlsext_host_name(*o_ssl, hostname); if(SSL_connect(*o_ssl) != 1) { SSL_CTX_free(*o_ctx); SSL_free(*o_ssl); diff --git a/W3Version.h.m4 b/W3Version.h.m4 index e7bd535..6c054cd 100644 --- a/W3Version.h.m4 +++ b/W3Version.h.m4 @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "2.20C" \ +#define LIBW3_VERSION "2.20D" \ SUFFIX ifdef(`HTTP_SUPPORT', `#define LIBW3_HTTP_SUPPORT', `') -- 2.43.0