com.huawei.opengauss.jdbc.ssl.LibPQFactory.class Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opengaussjdbc Show documentation
Show all versions of opengaussjdbc Show documentation
HuaweiCloud JDBC for GaussDB
The newest version!
???? 4\ *com/huawei/opengauss/jdbc/ssl/LibPQFactory ,com/huawei/opengauss/jdbc/ssl/WrappedFactory LibPQFactory.java Acom/huawei/opengauss/jdbc/ssl/LibPQFactory$ConsoleCallbackHandler ConsoleCallbackHandler Bcom/huawei/opengauss/jdbc/ssl/NonValidatingFactory$NonValidatingTM 2com/huawei/opengauss/jdbc/ssl/NonValidatingFactory NonValidatingTM km .Lcom/huawei/opengauss/jdbc/ssl/LazyKeyManager; LOGGER #Lcom/huawei/opengauss/jdbc/log/Log; (Ljava/util/Properties;)V ,com/huawei/opengauss/jdbc/util/PSQLException java/lang/Exception java/security/KeyStoreException java/io/FileNotFoundException java/io/IOException &java/security/GeneralSecurityException $java/security/KeyManagementException &java/security/NoSuchAlgorithmException " ()V $
% TLSv1.2 ' javax/net/ssl/SSLContext ) getInstance .(Ljava/lang/String;)Ljavax/net/ssl/SSLContext; + ,
* - file.separator / java/lang/System 1 getProperty &(Ljava/lang/String;)Ljava/lang/String; 3 4
2 5 os.name 7 java/lang/String 9 toLowerCase ()Ljava/lang/String; ; <
: = windows ? contains (Ljava/lang/CharSequence;)Z A B
: C java/lang/StringBuilder E
F % APPDATA H getenv J 4
2 K append -(Ljava/lang/String;)Ljava/lang/StringBuilder; M N
F O
postgresql Q toString S <
F T java/util/Properties V user.home X .postgresql Z $com/huawei/opengauss/jdbc/PGProperty \ SSL_CERT &Lcom/huawei/opengauss/jdbc/PGProperty; ^ _ ] ` get *(Ljava/util/Properties;)Ljava/lang/String; b c
] d postgresql.crt f SSL_KEY h _ ] i postgresql.pk8 k SSL_PASSWORD_CALLBACK m _ ] n ,javax/security/auth/callback/CallbackHandler p ,com/huawei/opengauss/jdbc/util/ObjectFactory r instantiate `(Ljava/lang/Class;Ljava/lang/String;Ljava/util/Properties;ZLjava/lang/String;)Ljava/lang/Object; t u
s v CThe password callback class provided {0} could not be instantiated. x java/lang/Object z !com/huawei/opengauss/jdbc/util/GT | tr 9(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; ~
} ? (com/huawei/opengauss/jdbc/util/PSQLState ? CONNECTION_FAILURE *Lcom/huawei/opengauss/jdbc/util/PSQLState; ? ? ? ? T(Ljava/lang/String;Lcom/huawei/opengauss/jdbc/util/PSQLState;Ljava/lang/Throwable;)V ?
? SSL_PASSWORD ? _ ] ? (Ljava/lang/String;)V ?
? ,com/huawei/opengauss/jdbc/ssl/LazyKeyManager ? ? equals (Ljava/lang/Object;)Z ? ?
: ? SSL_PRIVATEKEY_FACTORY ? _ ] ? h(Ljava/lang/String;Ljava/lang/String;Ljavax/security/auth/callback/CallbackHandler;ZLjava/lang/String;)V ?
? ? ? &com/huawei/opengauss/jdbc/jdbc/SslMode ? of @(Ljava/util/Properties;)Lcom/huawei/opengauss/jdbc/jdbc/SslMode; ? ?
? ? verifyCertificate ()Z ? ?
? ? javax/net/ssl/TrustManager ?
% PKIX ? !javax/net/ssl/TrustManagerFactory ? 7(Ljava/lang/String;)Ljavax/net/ssl/TrustManagerFactory; + ?
? ? jks ? java/security/KeyStore ? ,(Ljava/lang/String;)Ljava/security/KeyStore; + ?
? ? jks KeyStore not available ?
# ?
SSL_ROOT_CERT ? _ ] ? root.crt ? java/io/FileInputStream ?
? ? -Could not open SSL root certificate file {0}. ? X.509 ? %java/security/cert/CertificateFactory ? ;(Ljava/lang/String;)Ljava/security/cert/CertificateFactory; + ?
? ? generateCertificates -(Ljava/io/InputStream;)Ljava/util/Collection; ? ?
? ? java/security/cert/Certificate ? java/util/Collection ? toArray (([Ljava/lang/Object;)[Ljava/lang/Object; ? ? ? ? load (Ljava/io/InputStream;[C)V ? ?
? ? [Ljava/lang/Object; ? cert ? (I)Ljava/lang/StringBuilder; M ?
F ? setCertificateEntry 5(Ljava/lang/String;Ljava/security/cert/Certificate;)V ? ?
? ? init (Ljava/security/KeyStore;)V ? ?
? ? close ? $
? ? ? Catch IOException on close: ? !com/huawei/opengauss/jdbc/log/Log ? trace *(Ljava/lang/Object;Ljava/lang/Throwable;)V ? ? ? ? -Could not read SSL root certificate file {0}. ? @Loading the SSL root certificate {0} into a TrustManager failed. ? java/lang/Throwable getTrustManagers ()[Ljavax/net/ssl/TrustManager;
? [Ljavax/net/ssl/TrustManager; javax/net/ssl/KeyManager W([Ljavax/net/ssl/KeyManager;[Ljavax/net/ssl/TrustManager;Ljava/security/SecureRandom;)V ?
* !Could not initialize SSL context.
getSocketFactory "()Ljavax/net/ssl/SSLSocketFactory;
* _factory Ljavax/net/ssl/SSLSocketFactory; 3Could not find a java cryptographic algorithm: {0}.
getMessage <
#
defaultdir Ljava/lang/String; cbh .Ljavax/security/auth/callback/CallbackHandler; e Ljava/lang/Exception; tm ks Ljava/security/KeyStore; !Ljava/security/KeyStoreException; fis Ljava/io/FileInputStream; ex Ljava/io/FileNotFoundException; i I cf 'Ljava/security/cert/CertificateFactory; certs Ljava/io/IOException; ioex gsex (Ljava/security/GeneralSecurityException; tmf #Ljavax/net/ssl/TrustManagerFactory; sslrootcertfile &Ljava/security/KeyManagementException; ctx Ljavax/net/ssl/SSLContext; pathsep defaultfile Z sslcertfile
sslkeyfile sslpasswordcallback sslMode (Lcom/huawei/opengauss/jdbc/jdbc/SslMode; (Ljava/security/NoSuchAlgorithmException; this ,Lcom/huawei/opengauss/jdbc/ssl/LibPQFactory; info Ljava/util/Properties; throwKeyManagerExceptionF $
?G java/lang/ClassJ getNameL <
KM $com/huawei/opengauss/jdbc/log/LoggerO getLogger 7(Ljava/lang/String;)Lcom/huawei/opengauss/jdbc/log/Log;QR
PS Code LocalVariableTable LineNumberTable
StackMapTable
Exceptions
SourceFile InnerClasses !
U j ?*? &(? .M0? 6N68? 6? >@? D? '? FY? GI? L? P-? PR? P-? P? U:? $? FY? GY? 6? P-? P[? P-? P? U:? a+? e:? 6? FY? G? Pg? P? U:? j+? e:? 6? FY? G? Pl? P? U:? o+? e: ? 2q +? w? q:? 0:
? Yy? {Y S? ?? ?
? ??? Y? ?+? e? ?:*? ?Y?? ?? ? ?? ?? ? ? ?+? e? ?? ?+? ?:? ?? ? ?Y?
Y? ?S:
?=?? ?:?? ?:
? :? #Y?? ??? ?+? e:? ? FY? G? Pö P? U:? ?Y? ?:? :? Y?? {YS? ?? ?? ??ʸ ?:? ?? չ ? :
? ?6?? *
? FY? G? P? ? U2? ն ????
? ?? ? i:? ??? ? ? X:? Y?? {YS? ?? ?? ??:? Y?? {YS? ?? ?? ??:? ? :? ??? ? ??:
,? Y*? ?S
?? :? Y? {? ?? ?? ??*,??? !M? Y? {Y,?S? ?? ?,? ??? ? ? ? ahk ??? $' ?8 ?U ?r ty| 8tr ??? ! ?? # V L ! D ? ? !
W "
h #$
m
% ? &' ? () ? /*+ ? R,- ? @. ? ) / : 0/ W 12 ~ / a334 w#$
?5 ? ?&' ? (6
?78 ?9 hb ?:; qY< ?2= ? ?> ? 6"
???@ ? (A ?BC ?DE W 6 M 5 7
: <