View Javadoc
1   /*
2    * SPDX-FileCopyrightText: Copyright (c) 2011-2025 Yegor Bugayenko
3    * SPDX-License-Identifier: MIT
4    */
5   package com.jcabi.http.wire;
6   
7   import com.jcabi.http.request.JdkRequest;
8   import com.jcabi.http.response.RestResponse;
9   import java.net.HttpURLConnection;
10  import org.junit.jupiter.params.ParameterizedTest;
11  import org.junit.jupiter.params.provider.CsvSource;
12  
13  /**
14   * Integration case for {@link TrustedWire}.
15   *
16   * @since 1.10.1
17   */
18  final class TrustedWireITCase {
19  
20      /**
21       * TrustedWire can ignore SSL verifications.
22       * @param url URL with SSL problems
23       * @throws Exception If something goes wrong inside
24       */
25      @ParameterizedTest
26      @CsvSource({
27          "https://expired.badssl.com/",
28          "https://self-signed.badssl.com/",
29          "https://untrusted-root.badssl.com/"
30      })
31      void ignoresSslCertProblems(final String url) throws Exception {
32          new JdkRequest(url)
33              .through(TrustedWire.class)
34              .fetch()
35              .as(RestResponse.class)
36              .assertStatus(HttpURLConnection.HTTP_OK);
37      }
38  
39  }