1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-11-20 18:31:51 +03:00

Add more TLS negotiation info in logging and UI

This commit is contained in:
Yihong Wu
2021-12-26 12:31:53 +08:00
parent f94ac6351e
commit 0a4455ac40
16 changed files with 173 additions and 12 deletions

View File

@ -9,6 +9,7 @@
#include "Cedar.h"
#include "Command.h"
#include "Logging.h"
#include "Wpc.h"
#include "Mayaqua/Encrypt.h"
@ -19,6 +20,7 @@
#include "Mayaqua/Object.h"
#include "Mayaqua/Pack.h"
#include "Mayaqua/Str.h"
#include "Mayaqua/Table.h"
#include "Mayaqua/Tick64.h"
#include <stdlib.h>
@ -80,6 +82,9 @@ void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param)
{
SOCK *ns;
Debug("Connect Request from %r:%u\n", &client_ip, client_port);
char ipstr[128];
IPToStr(ipstr, sizeof(ipstr), &client_ip);
SLog(ac->Cedar, "LS_AZURE_START", ipstr, client_port);
// Create new socket and connect VPN Azure Server
if (ac->DDnsStatusCopy.InternetSetting.ProxyType == PROXY_DIRECT)
@ -103,9 +108,10 @@ void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param)
SetTimeout(ns, param->DataTimeout);
UINT ssl_err = 0;
Copy(&ns->SslAcceptSettings, &ac->Cedar->SslAcceptSettings, sizeof(SSL_ACCEPT_SETTINGS));
if (StartSSLEx(ns, NULL, NULL, 0, NULL))
if (StartSSLEx3(ns, NULL, NULL, NULL, 0, NULL, NULL, &ssl_err))
{
// Check certification
char server_cert_hash_str[MAX_SIZE];
@ -159,6 +165,13 @@ void AcWaitForRequest(AZURE_CLIENT *ac, SOCK *s, AZURE_PARAM *param)
}
}
}
else
{
if (ssl_err != 0)
{
SLog(ac->Cedar, "LS_AZURE_SSL_ERROR", GetUniErrorStr(ssl_err), ssl_err);
}
}
ReleaseSock(ns);
}