File tree Expand file tree Collapse file tree
http-clients/apache5-client/src/main/java/software/amazon/awssdk/http/apache5 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import java .security .cert .CertificateException ;
3232import java .security .cert .X509Certificate ;
3333import java .time .Duration ;
34+ import java .util .Arrays ;
3435import java .util .Iterator ;
3536import java .util .Optional ;
3637import java .util .concurrent .TimeUnit ;
@@ -780,24 +781,16 @@ private static void checkTcpSocketOptionPermissions() {
780781 + String .join ("\" , \" " , REQUIRED_TCP_SOCKET_OPTION_PERMISSIONS )
781782 + "\" when a SecurityManager is active." , e );
782783 }
783- log .debug (() -> "SecurityManager denied a non-TCP socket option permission during "
784- + "verification: " + e .getMessage (), e );
784+ log .debug (() -> "SecurityManager denied a non-TCP socket option permission during verification: "
785+ + e .getMessage (), e );
785786 } catch (Exception e ) {
786787 log .debug (() -> "Could not verify jdk.net.NetworkPermission for TCP socket options: " + e .getMessage (), e );
787788 }
788789 }
789790
790- private static boolean isTcpSocketOptionPermissionDenied (SecurityException e ) {
791- String message = e .getMessage ();
792- if (message == null ) {
793- return false ;
794- }
795- for (String perm : REQUIRED_TCP_SOCKET_OPTION_PERMISSIONS ) {
796- if (message .contains (perm )) {
797- return true ;
798- }
799- }
800- return false ;
791+ private static boolean isTcpSocketOptionPermissionDenied (SecurityException securityException ) {
792+ String message = securityException .getMessage ();
793+ return message != null && Arrays .stream (REQUIRED_TCP_SOCKET_OPTION_PERMISSIONS ).anyMatch (message ::contains );
801794 }
802795
803796 }
You can’t perform that action at this time.
0 commit comments