Home > Blockchain >  Using Boost Beast to build Platform specific client-side authentication in SSL connection
Using Boost Beast to build Platform specific client-side authentication in SSL connection

Time:03-21

I’m working on boost::beast based application on macOS platform, and I wonder how I can provide a client-side certificate to authenticate against the server ?

basically , in macOS the certificates are stored in keychain, and cannot be exported (backed by dedicated hardware called secured-enclave for better security)…

So I wonder if there’s any callback suitable to sign server’s challenge manually with native macOS native code that send the challenge to the keychain/secure-enclave for signing.

basically, I'm looking for a callback that have roughly the following signature :

bool validate_client_side_certificate(const std::string& challenge) 
    

CodePudding user response:

See set_verify_callback

There are examples here:

  • asio/example/cpp11/ssl/client.cpp
  • asio/example/cpp03/ssl/client.cpp

You can see it integrated in Beast's ssl_stream: https://www.boost.org/doc/libs/1_78_0/libs/beast/doc/html/beast/ref/boost__beast__ssl_stream/set_verify_callback/overload2.html

  • Related