/** * Sets a certificate to be used for SSL authentication. See {@link Class#getResource(String)} for how to get a URL from a resource * on the classpath. * <p/> * * @param certURL URL to a JKS keystore where the certificate is stored. * @param password The password for the keystore * @param certificateAuthSettings More advanced settings for the certificate authentication */ public static AuthenticationScheme certificate(String certURL, String password, CertificateAuthSettings certificateAuthSettings) { return certificate(certURL, password, "", "", certificateAuthSettings); }
/** * Sets a certificate to be used for SSL authentication. See {@link Class#getResource(String)} for how to get a URL from a resource * on the classpath. * * @param certURL URL to a JKS keystore where the certificate is stored. * @param password password to decrypt the keystore * @param keystoreType The keystore type * @param port The SSL port * @deprecated Use {@link #certificate(String, String, com.jayway.restassured.authentication.CertificateAuthSettings)} instead. */ @Deprecated public static AuthenticationScheme certificate(String certURL, String password, String keystoreType, int port) { return certificate(certURL, password, certAuthSettings().keystoreType(keystoreType).port(port)); }
/** * Sets a certificate to be used for SSL authentication. See {@link java.lang.Class#getResource(String)} * for how to get a URL from a resource on the classpath. * <p> * Uses SSL settings defined in {@link com.jayway.restassured.config.SSLConfig}. * </p> * * @param certURL URL to a JKS keystore where the certificate is stored. * @param password The password for the keystore * @return The request com.jayway.restassured.specification */ public static AuthenticationScheme certificate(String certURL, String password) { SSLConfig sslConfig = config().getSSLConfig(); return certificate(certURL, password, certAuthSettings().keystoreType(sslConfig.getKeyStoreType()).trustStore(sslConfig.getTrustStore()). keyStore(sslConfig.getKeyStore()).trustStoreType(sslConfig.getTrustStoreType()).x509HostnameVerifier(sslConfig.getX509HostnameVerifier()). port(sslConfig.getPort()).sslSocketFactory(sslConfig.getSSLSocketFactory())); }