2 library(ssl): Secure Socket Layer (SSL) library
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog SSL Interface
        • library(ssl): Secure Socket Layer (SSL) library
          • ssl_context/3
          • ssl_upgrade_legacy_options/2
          • ssl_add_certificate_key/4
          • ssl_set_options/3
          • ssl_property/2
          • ssl_negotiate/5
          • ssl_peer_certificate/2
          • ssl_peer_certificate_chain/2
          • ssl_session/2
          • load_certificate/2
          • write_certificate/3
          • load_crl/2
          • system_root_certificates/1
          • load_private_key/3
          • load_public_key/2
          • cert_accept_any/5
          • same_certificate/2
          • verify_certificate_issuer/2
          • verify_certificate/3
          • certificate_field/2
          • ssl_secure_ciphers/1
Availability::- use_module(library(ssl)).(can be autoloaded)
Source[semidet]ssl_peer_certificate(+Stream, -Certificate)
True if the peer certificate is provided (this is always the case for a client connection) and Certificate unifies with the peer certificate. The example below uses this to obtain the Common Name of the peer after establishing an https client connection:
  http_open(HTTPS_url, In, []),
  ssl_peer_certificate(In, Cert),
  memberchk(subject(Subject), Cert),
  memberchk('CN' = CommonName), Subject)