From 04894bf1e86acd3f1ea409ea742c0f9006fd9f08 Mon Sep 17 00:00:00 2001 From: Arif Burak Demiray <57103426+arifBurakDemiray@users.noreply.github.com> Date: Mon, 11 Mar 2024 14:28:51 +0000 Subject: [PATCH] Update dated-out authType check for SSLSecurity (#249) --- .../java/ly/count/sdk/java/internal/Transport.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java index f275270f..c158e4fb 100644 --- a/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java +++ b/sdk-java/src/main/java/ly/count/sdk/java/internal/Transport.java @@ -465,8 +465,12 @@ public void checkServerTrusted(X509Certificate[] chain, String authType) throws throw new IllegalArgumentException("PublicKeyManager: X509Certificate is empty"); } - if (!(null != authType && authType.contains("RSA"))) { - throw new CertificateException("PublicKeyManager: AuthType is not RSA"); + if (authType == null) { + throw new CertificateException("PublicKeyManager: AuthType is null"); + } + + if (authType.isEmpty()) { + throw new CertificateException("PublicKeyManager: AuthType is empty"); } // Perform standard SSL/TLS checks @@ -496,4 +500,4 @@ public void checkServerTrusted(X509Certificate[] chain, String authType) throws public X509Certificate[] getAcceptedIssuers() { return new X509Certificate[0]; } -} \ No newline at end of file +}