Can now control SSL cert verfication from in-engine

This commit is contained in:
2022-03-18 16:25:20 -04:00
parent 2e7b793110
commit 2e3bef79b3
8 changed files with 392 additions and 204 deletions

View File

@@ -55,17 +55,15 @@ static PADDRINFOA find_good_addr(PADDRINFOA addrinfo) {
return nullptr;
}
static SOCKET open_connection(std::string_view target, std::string &err) {
static SOCKET open_connection(const char *host, const char *port, std::string &err) {
PADDRINFOA addrs = nullptr;
PADDRINFOA goodaddr = nullptr;
SOCKET sock = INVALID_SOCKET;
std::string_view host, port;
err.clear();
util::split_host_port(target, host, port);
int status = getaddrinfo(host.data(), port.data(), nullptr, &addrs);
int status = getaddrinfo(host, port, nullptr, &addrs);
while (status == WSATRY_AGAIN) {
status = getaddrinfo(host.data(), port.data(), nullptr, &addrs);
status = getaddrinfo(host, port, nullptr, &addrs);
}
if (status == WSAHOST_NOT_FOUND) {
err = "host not found";