Skip to content

Leverage OS support (such as Windows' CryptoAPI) for Ncat SSL cert verification instead of out-of-date cert bundle #42

Open

Activity

  1. dmiller-nmap commented on Oct 13, 2020

    @dmiller-nmap
    Author

    From the Nmap todo file:

    Deal with our out-of-date CA root certificate bundle by either using
    OS-specific mechanisms and/or updating the latest from Mozilla or
    another source. See http://seclists.org/nmap-dev/2014/q4/200

  2. dmiller-nmap commented on Apr 13, 2026

    @dmiller-nmap
    Author

    Potential way ahead, per ChatGPT:

    A. Perform the TLS handshake with OpenSSL but skip or minimize OpenSSL’s own cert validation.

    Set verification mode to SSL_VERIFY_PEER, but provide a verify_callback that ignores OpenSSL’s verdict.

    B. Extract the presented certificate chain from the OpenSSL session.

    Use SSL_get_peer_cert_chain() or related calls.

    C. Pass that chain into the system’s trust API:

    macOS: Security.framework (SecTrustCreateWithCertificates, SecTrustEvaluateWithError).
    Windows: CryptoAPI (CertCreateCertificateChainEngine, CertGetCertificateChain).

    D. Accept or reject the connection based on the OS result.

    This produces correct platform-native trust decisions, but it is external to OpenSSL’s verification mechanism. OpenSSL never uses the OS trust store internally; you simply ignore its built-in verdict and substitute your own.

  3. changed the title [-]Leverage Windows' CryptoAPI for cert verification in Ncat[/-] [+]Leverage OS support (such as Windows' CryptoAPI) for Ncat SSL cert verification instead of out-of-date cert bundle[/+] on Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions