From 3acf29c54903b746db668b33cbad3d1fae41e970 Mon Sep 17 00:00:00 2001 From: Paul Santapau Date: Fri, 21 Oct 2016 18:09:25 +0200 Subject: [PATCH] URL for the TSL tests extracted to configuration --- .../java/net/continuumsecurity/steps/SSLyzeSteps.java | 9 ++++++--- src/test/resources/features/ssl.feature | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/test/java/net/continuumsecurity/steps/SSLyzeSteps.java b/src/test/java/net/continuumsecurity/steps/SSLyzeSteps.java index 6975d4e9..54acd2e8 100755 --- a/src/test/java/net/continuumsecurity/steps/SSLyzeSteps.java +++ b/src/test/java/net/continuumsecurity/steps/SSLyzeSteps.java @@ -6,6 +6,7 @@ import net.continuumsecurity.jsslyze.JSSLyze; import java.io.IOException; +import java.net.URL; import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; @@ -18,12 +19,14 @@ */ public class SSLyzeSteps { final static String OUTFILENAME = "sslyze.output"; + static String host=null; - @When("^the SSLyze command is run against the host (.*) on port (\\d+)$") - public void runSSLTestsOnSecureBaseUrl(String host, int port) throws IOException { + @When("^the SSLyze command is run against the application on port (\\d+)$") + public void runSSLTestsOnSecureBaseUrl(int port) throws IOException { if (!World.getInstance().isSslRunCompleted()) { + host= new URL(Config.getInstance().getBaseUrl()).getHost(); JSSLyze jSSLLyze = new JSSLyze(Config.getInstance().getSSLyzePath(), OUTFILENAME); - jSSLLyze.execute(Config.getInstance().getSSLyzeOption(),host,port); + jSSLLyze.execute(Config.getInstance().getSSLyzeOption(), host, port); World.getInstance().setjSSLyze(jSSLLyze); World.getInstance().setSslRunCompleted(true); } diff --git a/src/test/resources/features/ssl.feature b/src/test/resources/features/ssl.feature index 6725139d..b2e6d704 100644 --- a/src/test/resources/features/ssl.feature +++ b/src/test/resources/features/ssl.feature @@ -3,7 +3,7 @@ Feature: SSL Ensure that the SSL configuration of the service is robust Background: Run the SSLyze command only once for all features - When the SSLyze command is run against the host www.continuumsecurity.net on port 443 + When the SSLyze command is run against the application on port 443 @ssl_crime Scenario: Disable SSL deflate compression in order to mitigate the risk of the CRIME attack