/** * Use relaxed HTTP validation with protocol {@value #SSL}. This means that you'll trust all hosts regardless if the SSL certificate is invalid. By using this * method you don't need to specify a keystore (see {@link #keystore(String, String)} or trust store (see {@link #trustStore(java.security.KeyStore)}. * <p> * This is just a shortcut for: * </p> * <pre> * RestAssured.config = RestAssured.config().sslConfig(sslConfig().relaxedHTTPSValidation()); * </pre> */ public static void useRelaxedHTTPSValidation() { useRelaxedHTTPSValidation(SSL); }
@BeforeClass static public void setup() throws MalformedURLException { // set base URI and port number to use for all requests String serverUrl = System.getProperty("test.url"); String protocol = DEFAULT_PROTOCOL; String host = DEFAULT_HOST; int port = DEFAULT_PORT; if (serverUrl != null) { URL url = new URL(serverUrl); protocol = url.getProtocol(); host = url.getHost(); port = (url.getPort() == -1) ? DEFAULT_PORT : url.getPort(); } RestAssured.baseURI = protocol + "://" + host; RestAssured.port = port; // set user name and password to use for basic authentication for all requests String userName = System.getProperty("test.user"); String password = System.getProperty("test.pwd"); if (userName != null && password != null) { RestAssured.authentication = RestAssured.basic(userName, password); RestAssured.useRelaxedHTTPSValidation(); } }
@BeforeClass static public void setup() throws MalformedURLException { // set base URI and port number to use for all requests String serverUrl = System.getProperty("test.url"); String protocol = DEFAULT_PROTOCOL; String host = DEFAULT_HOST; int port = DEFAULT_PORT; if (serverUrl != null) { URL url = new URL(serverUrl); protocol = url.getProtocol(); host = url.getHost(); port = (url.getPort() == -1) ? DEFAULT_PORT : url.getPort(); } RestAssured.baseURI = protocol + "://" + host; RestAssured.port = port; // set user name and password to use for basic authentication for all requests String userName = System.getProperty("test.user"); String password = System.getProperty("test.pwd"); if (userName != null && password != null) { RestAssured.authentication = RestAssured.basic(userName, password); RestAssured.useRelaxedHTTPSValidation(); } }
server = options.getOptionValue("server"); if (StringUtils.startsWith(server, "https:")) { // allow self-signed certificates for development servers RestAssured.useRelaxedHTTPSValidation();
@BeforeClass public static void setUp() throws NameRegistrar.NotFoundException { RestAssured.baseURI = BASE_URL; RestAssured.useRelaxedHTTPSValidation(); RestAssured.requestSpecification = new RequestSpecBuilder().build().contentType(APPLICATION_JSON.toString()); if (q2 == null) { q2 = new Q2(); q2.start(); NameRegistrar.get("qrest", 60000L); NameRegistrar.get("qrest"); // this time throw exception } }