RetailMeNot / TestRailSDK

TestRail integration with Java WebDriver implementation.
MIT License
25 stars 27 forks source link

Configurable HTTPS TestRail server url #13

Open pitchumani-rpm opened 9 years ago

pitchumani-rpm commented 9 years ago

Hi, We are running testrail server in intranet environment in https mode. For now you have supported for http only, but we need for https. Before we are using the testrail version 3.0.1 and we configured your code to use https. But now we upgraded the testail to 4.0.1.3267 version. From now onwards https configuration is not working. Got the following exception, java.lang.RuntimeException: Connection is null (probably hit timeout), check parameters for [https://ipaddress/testrail].

mmerrell commented 9 years ago

Thanks for letting us know. We will get to work on this and let you know when we can cut a new release. MM

pitchumani-rpm commented 9 years ago

Thank you.

pitchumani-rpm commented 9 years ago

Hi, i have made the changes in your 1.0 snapshot code, now i get the following exception,

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target...

Can you help me to resolve this problem.

mmerrell commented 9 years ago

It's hard to know how to help without knowing your changes. Can you push a branch and create a pull request so I can have a look?

Thanks, MM

Luvs1015 commented 8 years ago

any update on this item?

jpratik21 commented 8 years ago

Wondering if this is fixed?

Here are my error logs:

[Utils] Attempting to create /Users/pjaiswal/work/mobile-test/test-output/Default suite/Default test.html
[Utils]   Directory /Users/pjaiswal/work/mobile-test/test-output/Default suite exists: true
[Utils] Attempting to create /Users/pjaiswal/work/mobile-test/test-output/Default suite/Default test.xml
[Utils]   Directory /Users/pjaiswal/work/mobile-test/test-output/Default suite exists: true
FAILED CONFIGURATION: @BeforeClass railSetup
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1904)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
    at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:273)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1446)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:901)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:837)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1023)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at qa.mobile.common.utils.testrail.client.APIClient.sendRequest(APIClient.java:155)
    at qa.mobile.common.utils.testrail.client.APIClient.sendGet(APIClient.java:93)
vinceis1337 commented 8 years ago

@jpratik21 The stacktrace doesn't show me which codefile is the culprit here. It appears that APIClient is your code. Can you show me the code that is failing?

Did you try this: https://confluence.atlassian.com/kb/unable-to-connect-to-ssl-services-due-to-pkix-path-building-failed-779355358.html

It is for Confluence but it is similar to your problem.

jpratik21 commented 8 years ago

@vinceis1337

I tried that link and it did not help - says UnknownHostException.

My code is failing at this line: JSONArray arr = (JSONArray) client.sendGet(uri.GET_PROJECTS.toString());

And here are some additional details:

https://discuss.gurock.com/t/https-http-ssl-handshake-exception-while-using-testrail-java-api/3466

I am kind of stuck and sounds like some HTTPS/SSL/Certificate error. Not sure if its on my/client side or the server side. Python API is able to get the test case from TestRail (just tested). However, for the Java it throws error shown in my 1st comment.

Any suggestion/solution would be appreciated.

vinceis1337 commented 8 years ago

@jpratik21 What version of TestRailSDK are you using? Are you on the latest ST-67 branch? I rewrote nearly the entire SDK but I introduced a bug which I just fixed minutes ago. That could have been the issue.

adityabhargav commented 4 years ago

Hi, We are running testrail server in intranet environment in https mode. For now you have supported for http only, but we need for https. Before we are using the testrail version 3.0.1 and we configured your code to use https. But now we upgraded the testail to 4.0.1.3267 version. From now onwards https configuration is not working. Got the following exception, java.lang.RuntimeException: Connection is null (probably hit timeout), check parameters for [https://ipaddress/testrail].

try with TestRailService testRailService = new TestRailService(new URL("Enter Ur URL here"), "XXXXXX@XXX.com", "XXXXXXXXX"); System.out.println(testRailService.verifyCredentials());