Skip to content

Commit

Permalink
Update ValidateSslCertificate method in accordance with recent change…
Browse files Browse the repository at this point in the history
…s to the security testing method (#765)
  • Loading branch information
AsabuHere authored Sep 22, 2023
1 parent 70a8967 commit 823a095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/twilio/Twilio.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 823a095

Please sign in to comment.