Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update ValidateSslCertificate method changes to the security testing method #765

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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