LY
Size: a a a
LY
S
System.
setProperty("javax.net.ssl.trustStore", "src/test/resources/certs/cacerts");
System.
setProperty("javax.net.ssl.keyStore", "src/test/resources/certs/keystore.jks");
System.
setProperty("javax.net.ssl.keyStorePassword", "changeit");
System.
setProperty("javax.net.ssl.trustStorePassword", "changeit");
// ensure all connection using HTTPS will use the SSL context defined by
// MockServer to allow dynamically generated certificates to be accepted
HttpsURLConnection.
setDefaultSSLSocketFactory(new KeyStoreFactory(new MockServerLogger()).sslContext().getSocketFactory());
ConfigurationProperties.
maxSocketTimeout(120000);
ConfigurationProperties.
dynamicallyCreateCertificateAuthorityCertificate(true);
ConfigurationProperties.
directoryToSaveDynamicSSLCertificate("src/test/resources/certs/");
ConfigurationProperties.
sslCertificateDomainName("localhost.local");
ConfigurationProperties.
addSslSubjectAlternativeNameDomains("www.example.com");
ConfigurationProperties.
addSslSubjectAlternativeNameIps("127.0.0.1");
ConfigurationProperties.
enableCORSForAPI(true);
ConfigurationProperties.
enableCORSForAllResponses(true);
ConfigurationProperties.
nioEventLoopThreadCount(500);
ConfigurationProperties.
forwardProxyTLSX509CertificatesTrustManagerType("ANY");
ConfigurationProperties.
forwardHttpsProxy();
ConfigurationProperties.
forwardHttpProxy();
S
LY
Web Browsers
Browsers (such as Chrome, Firefox or IE) may not always trust dynamically generated certificates from MockServer because of Certificate Transparency and Public Key Pinning both of which make it hard to dynamically generate certificates that are trusted.
Some sites will work but others (such as google sites) won't work due to certificate pinning.
Browser that rely on Certificate Transparency will likely not trust dynamically generated certificates from MockServer
LY
S
LY
AN
LY
KS
IC
AN
AS
open();
selenide-ru
DL
A
SM
KV
m
A
A