This issue was first discovered with circleci but the SSLHandShakeException is not reproduce in dev environment with my Mac. The detail error page is here. This post provides a verified way to bypass all hostname verification (or you can add specified conditions inside) for non-security test case to apply on Web API testing.
Above picture shows the exception details. Generally a RESTful WebAPI test could be constructed with OkHttpClient lib:
It is usually caused by a self-signed certificate or an unknown certificate signer. The official solution plan is to download the SSL certificate and install it to Java SSL keystore. However, for a quick fix to test environment only concerning about the function instead of security perspective here (suggest to keep security part in a seperate test set). If we would like to bypass all hostname verification, here is the solution with a customized hostverifier. With Java8 we can use lambda to replace anonymous class when the interface is a functional one.
Full code implementation could be referenced from Github Cucumber-Java-Toy Link in JUnite suite org.maxwu.jrefresh.HttpApi.SourceIpApiTest.