Commit dc1160d0 authored by jan.koester's avatar jan.koester
Browse files

tst

parent 0c970914
Loading
Loading
Loading
Loading
+1 −1
Changes for src/crypto/tls.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -1518,7 +1518,7 @@ namespace netplus {
        netplus::P256Point peer_ec_pub; /**< Client side (TLS 1.3): the server's EC public key, extracted from its leaf certificate when server_cert_is_ecdsa, used to verify CertificateVerify. */
        std::vector<std::vector<uint8_t>> peer_presented_certs; /**< Client side (TLS 1.3): every certificate the server presented, leaf first, DER-encoded, in presentation order. */

        /** @brief Client-side peer certificate verification policy (hostname/CA-chain/pinning); see cert_verify.h. Default-constructed = verify nothing, matching every consumer that doesn't opt in. */
        /** @brief Client-side peer certificate verification policy (hostname/CA-chain/pinning); see cert_verify.h. Default-constructed = verify (secure by default) -- consumers connecting to a self-signed/internal-CA peer must opt out explicitly (verifyPeer=false) or pin its fingerprint. */
        netplus::TlsTrustPolicy trust_policy;

        // --- TLS compatibility flags ---
+16 −3
Changes for src/posix/tcp.cpp: 16 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -381,7 +381,8 @@ void netplus::tcp::connect(const std::string& addr, int port, bool nonblock)
            if (sw.waitWrite(*this, kConnectAttemptTimeoutMs)) {
                int err = 0;
                socklen_t errlen = sizeof(err);
                if (::getsockopt(_Socket, SOL_SOCKET, SO_ERROR, &err, &errlen) == 0 && err == 0) {
                if (::getsockopt(_Socket, SOL_SOCKET, SO_ERROR, &err, &errlen) == 0) {
                    if (err == 0) {
                        setBlock();
                        setAddrFromAI(rp);

@@ -391,6 +392,11 @@ void netplus::tcp::connect(const std::string& addr, int port, bool nonblock)
                        ::freeaddrinfo(result);
                        return;
                    }
                    // Real failure (e.g. ECONNREFUSED) -- surface it in the final
                    // exception below instead of the stale EINPROGRESS still sitting
                    // in errno from the ::connect() call above.
                    errno = err;
                }
            }

            ::close(_Socket);
@@ -489,7 +495,8 @@ void tcp::connectTimeout(const std::string& addr, int port, int timeout_ms) {
            if (sw.waitWrite(*this, remaining_ms)) {
                int err = 0;
                socklen_t errlen = sizeof(err);
                if (::getsockopt(_Socket, SOL_SOCKET, SO_ERROR, &err, &errlen) == 0 && err == 0) {
                if (::getsockopt(_Socket, SOL_SOCKET, SO_ERROR, &err, &errlen) == 0) {
                    if (err == 0) {
                        setBlock();
                        setAddrFromAI(rp);

@@ -499,6 +506,11 @@ void tcp::connectTimeout(const std::string& addr, int port, int timeout_ms) {
                        ::freeaddrinfo(result);
                        return;
                    }
                    // Real failure (e.g. ECONNREFUSED) -- surface it in the final
                    // exception below instead of the stale EINPROGRESS still sitting
                    // in errno from the ::connect() call above.
                    errno = err;
                }
            }
        }

@@ -510,7 +522,8 @@ void tcp::connectTimeout(const std::string& addr, int port, int timeout_ms) {

    exception[NetException::Error]
        << "tcp::connectTimeout: could not connect to "
        << addr << ":" << port;
        << addr << ":" << port
        << " (" << strerror(errno) << ")";
    throw exception;
}