klyn.net.ssl.SSLContext.withClientCertificate
method
public withClientCertificate(certificatePath as Object, privateKeyPath as Object) as SSLContext throws SSLException:
Description

Returns a copy with a client certificate and private key.

Parameters
ParameterDescription
certificatePathCertificate file (String or Path).
privateKeyPathPrivate key file (String or Path).
Throws
  • SSLException if TLS options, certificates, trust paths, or socket creation are invalid.
Example
import klyn.net.ssl

context = SSLContext.clientDefault().withClientCertificate("client.crt", "client.key")
print(context.clientCertificateFile)