Skip to content

Commit

Permalink
(#1443) Remove unnecessary SSL initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoss committed Apr 29, 2021
1 parent 8a34d58 commit fd1b1ca
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/test/java/org/cactoos/io/InputOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,35 +323,9 @@ void makesDataAvailable() throws Exception {
}

@Test
// @checkstyle MethodBodyCommentsCheck (50 lines)
void readsSecureUrlContent() throws Exception {
final TrustManager[] managers = {
new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}

@Override
public void checkClientTrusted(
final X509Certificate[] cert, final String arg) {
// nothing to do
}

@Override
public void checkServerTrusted(
final X509Certificate[] cert, final String arg) {
// nothing to do
}
},
};
final SSLContext context = SSLContext.getInstance("TLS");
context.init(null, managers, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(
context.getSocketFactory()
);
new Assertion<>(
"Can't read bytes from HTTPS URL",
"Must read bytes from HTTPS URL",
new BytesOf(
new InputOf(
new URL(
Expand Down

0 comments on commit fd1b1ca

Please sign in to comment.