File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
client/src/main/java/org/glassfish/tyrus/client
containers/jdk-client/src/main/java/org/glassfish/tyrus/container/jdk/client Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -578,6 +578,17 @@ public SSLContext createSSLContext() {
578578 TrustManagerFactory trustManagerFactory = null ;
579579 KeyManagerFactory keyManagerFactory = null ;
580580
581+ if ("SunMSCAPI" .equals (System .getProperty (TRUST_STORE_PROVIDER ))) {
582+ try {
583+ KeyStore keyStore = KeyStore .getInstance (System .getProperty (TRUST_STORE_TYPE ), "SunMSCAPI" );
584+ keyStore .load (null , null );
585+ trustManagerFactory = TrustManagerFactory .getInstance (TrustManagerFactory .getDefaultAlgorithm ());
586+ trustManagerFactory .init (keyStore );
587+ } catch (Throwable e ) {
588+ throw new RuntimeException (e );
589+ }
590+ }
591+
581592 if (keyStoreBytes != null || keyStoreFile != null ) {
582593 try {
583594 KeyStore keyStore ;
Original file line number Diff line number Diff line change @@ -524,6 +524,17 @@ public SSLContext createSSLContext() {
524524
525525 try {
526526 TrustManagerFactory trustManagerFactory = null ;
527+ if ("SunMSCAPI" .equals (System .getProperty (TRUST_STORE_PROVIDER ))) {
528+ try {
529+ KeyStore keyStore = KeyStore .getInstance (System .getProperty (TRUST_STORE_TYPE ), "SunMSCAPI" );
530+ keyStore .load (null , null );
531+ trustManagerFactory = TrustManagerFactory .getInstance (TrustManagerFactory .getDefaultAlgorithm ());
532+ trustManagerFactory .init (keyStore );
533+ } catch (Throwable e ) {
534+ throw new RuntimeException (e );
535+ }
536+ }
537+
527538 KeyManagerFactory keyManagerFactory = null ;
528539
529540 if (keyStoreBytes != null || keyStoreFile != null ) {
You can’t perform that action at this time.
0 commit comments