feat: enable ALPN (http 1.1)

This commit is contained in:
2026-06-19 07:54:58 -03:00
parent 6ad87ecc18
commit dad8cb55d7
+6
View File
@@ -435,6 +435,12 @@ void TinyMITMProxy::handleClient(SOCKET clientSocket)
wolfSSL_set_fd(clientSSL.get(), (int)clientGuard); wolfSSL_set_fd(clientSSL.get(), (int)clientGuard);
wolfSSL_set_fd(remoteSSL.get(), (int)remoteGuard); wolfSSL_set_fd(remoteSSL.get(), (int)remoteGuard);
char alpnList[] = "http/1.1";
wolfSSL_UseALPN(remoteSSL.get(), alpnList, static_cast<word32>(strlen(alpnList)),
WOLFSSL_ALPN_CONTINUE_ON_MISMATCH);
wolfSSL_UseALPN(clientSSL.get(), alpnList, static_cast<word32>(strlen(alpnList)),
WOLFSSL_ALPN_CONTINUE_ON_MISMATCH);
wolfSSL_UseSNI(remoteSSL.get(), WOLFSSL_SNI_HOST_NAME, host.c_str(), (unsigned short)host.size()); wolfSSL_UseSNI(remoteSSL.get(), WOLFSSL_SNI_HOST_NAME, host.c_str(), (unsigned short)host.size());
setNonBlocking(clientGuard, true); setNonBlocking(clientGuard, true);