Skip to content

Commit

Permalink
Validate ssl method update (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsabuHere authored Oct 6, 2023
1 parent 9da3278 commit 7a8223f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/twilio/Twilio.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public static void setExecutorService(final ExecutorService executorService) {
}

/**
* Validate that we can connect to the new SSL certificate posted on api.twilio.com.
* Validate that we can connect to the new SSL certificate posted on tls-test.twilio.com
*
* @throws CertificateValidationException if the connection fails
*/
Expand All @@ -252,7 +252,7 @@ public static void validateSslCertificate() {


public static void validateSslCertificate(NetworkHttpClient client) {
final Request request = new Request(HttpMethod.GET, "https://api.twilio.com:8443");
final Request request = new Request(HttpMethod.GET, "https://tls-test.twilio.com:443");
try {
final Response response = client.makeRequest(request);

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/twilio/TwilioTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void testSetRestClient() {

@Test
public void testValidateSslCertificateError() {
final Request request = new Request(HttpMethod.GET, "https://api.twilio.com:8443");
final Request request = new Request(HttpMethod.GET, "https://tls-test.twilio.com:443");
when(networkHttpClient.makeRequest(request)).thenReturn(new Response("", 500));
try {
Twilio.validateSslCertificate(networkHttpClient);
Expand All @@ -140,7 +140,7 @@ public void testValidateSslCertificateError() {

@Test
public void testValidateSslCertificateException() {
final Request request = new Request(HttpMethod.GET, "https://api.twilio.com:8443");
final Request request = new Request(HttpMethod.GET, "https://tls-test.twilio.com:443");
when(networkHttpClient.makeRequest(request)).thenThrow(new ApiException("No"));

try {
Expand All @@ -153,7 +153,7 @@ public void testValidateSslCertificateException() {

@Test
public void testValidateSslCertificateSuccess() {
final Request request = new Request(HttpMethod.GET, "https://api.twilio.com:8443");
final Request request = new Request(HttpMethod.GET, "https://tls-test.twilio.com:443");
when(networkHttpClient.makeRequest(request)).thenReturn(new Response("", 200));

Twilio.validateSslCertificate(networkHttpClient);
Expand Down

0 comments on commit 7a8223f

Please sign in to comment.