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

test

parent 4c3dac56
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -391,6 +391,8 @@ namespace netplus {

		ssl(const std::map<std::string, CertificateBundle>& certs, const std::string& addr, int port, int maxconnections, int sockopts);

		void setCertificates(const std::map<std::string, CertificateBundle>& certs);

		void accept(std::unique_ptr<socket>& csock, bool nonblock) override;
		void handshake_after_accept() override { _tls.handshake_after_accept(); }
		void handshake_after_connect() override { _tls.handshake_after_connect(); }
+7 −0
Original line number Diff line number Diff line
@@ -75,6 +75,13 @@ ssl::ssl(std::shared_ptr<const std::map<std::string, CertificateBundle>> shared_
    _Type = sockettype::SSL;
}

void ssl::setCertificates(const std::map<std::string, CertificateBundle>& certs) {
    _tls.cert_map = std::make_shared<const std::map<std::string, CertificateBundle>>(certs);
    if (!certs.empty()) {
        _tls.selected_cert_bundle = const_cast<CertificateBundle*>(&_tls.cert_map->begin()->second);
    }
}

// ============================================================================
// Accept - Create child SSL socket for accepted connection
// ============================================================================