Monday, March 18, 2019

Installing Digital Certificates in Oracle Wallet using Keytool

Microsoft Windows [Version 10.0.17134.590]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>dir /s
 Volume in drive C is System
 Volume Serial Number is E28D-8D5E

 Directory of C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51

03/13/2019  11:28 AM    <DIR>          .
03/13/2019  11:28 AM    <DIR>          ..
03/09/2019  08:58 AM             1,360 DigiCertGlobalRootCA.crt
03/09/2019  08:58 AM             1,662 GeoTrustRSACA2018.crt
07/05/2018  02:32 PM             6,492 wsctt-wsvcoraclectt.p12
               3 File(s)          9,514 bytes

     Total Files Listed:
               3 File(s)          9,514 bytes
               2 Dir(s)  84,026,478,592 bytes free

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>keytool -v -importkeystore -srckeystore wsctt-wsvcoraclectt.p12 -srcstoretype PKCS12 -destkeystore wsctt.jks -deststoretype JKS
Importing keystore wsctt-wsvcoraclectt.p12 to wsctt.jks...
Enter destination keystore password:
Re-enter new password:
Enter source keystore password:
Entry for alias wsctt-wsvcoraclectt successfully imported.
Import command completed:  1 entries successfully imported, 0 entries failed or cancelled
[Storing wsctt.jks]

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore wsctt.jks -destkeystore wsctt.jks -deststoretype pkcs12".

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>keytool -import -alias Root -keystore wsctt.jks -trustcacerts -file DigiCertGlobalRootCA.crt
Enter keystore password:
Certificate already exists in system-wide CA keystore under alias <digicertglobalrootca [jdk]>
Do you still want to add it to your own keystore? [no]:  no
Certificate was not added to keystore

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore wsctt.jks -destkeystore wsctt.jks -deststoretype pkcs12".

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>keytool -import -alias Intermediate -keystore wsctt.jks -trustcacerts -file GeoTrustRSACA2018.crt
Enter keystore password:
Certificate was added to keystore

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore wsctt.jks -destkeystore wsctt.jks -deststoretype pkcs12".

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>orapki wallet create -wallet . -pwd aaaaa
Oracle PKI Tool : Version 12.1.0.1
Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>orapki wallet jks_to_pkcs12 -wallet ./ -pwd "aaaaa" -keystore ./wsctt.jks -jkspwd "aaaaa"
Oracle PKI Tool : Version 12.1.0.1
Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>orapki wallet display -wallet . -pwd aaaaa
Oracle PKI Tool : Version 12.1.0.1
Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.

Requested Certificates:
User Certificates:
Subject:        EmailAddress=pvats@pearson.com,CN=wsctt-wsvcoraclectt,OU=VUE,O=NCS Pearson,L=Bloomington,ST=Minnesota,C=US
Trusted Certificates:
Subject:        OU=Class 2 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        CN=GeoTrust RSA CA 2018,OU=www.digicert.com,O=DigiCert Inc,C=US
Subject:        CN=GTE CyberTrust Global Root,OU=GTE CyberTrust Solutions\, Inc.,O=GTE Corporation,C=US
Subject:        CN=Pearson VUE Root Certificate Authority
Subject:        CN=Pearson VUE CTT Certificate Authority,DC=pearsonvue,DC=com
Subject:        OU=Class 3 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        OU=Class 1 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>dir /s
 Volume in drive C is System
 Volume Serial Number is E28D-8D5E

 Directory of C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51

03/13/2019  11:30 AM    <DIR>          .
03/13/2019  11:30 AM    <DIR>          ..
03/09/2019  08:58 AM             1,360 DigiCertGlobalRootCA.crt
03/13/2019  11:30 AM            11,320 ewallet.p12
03/13/2019  11:30 AM                 0 ewallet.p12.lck
03/09/2019  08:58 AM             1,662 GeoTrustRSACA2018.crt
07/05/2018  02:32 PM             6,492 wsctt-wsvcoraclectt.p12
03/13/2019  11:30 AM             7,222 wsctt.jks
               6 File(s)         28,056 bytes

     Total Files Listed:
               6 File(s)         28,056 bytes
               2 Dir(s)  84,024,537,088 bytes free

C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51>sqlplus sys as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Wed Mar 13 11:34:22 2019

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>   SELECT UTL_HTTP.request (
  2            url               => 'https://wsctt.abc.com/cxfws2/services/Ping',
  3            proxy             =>  'http://www-proxy.com:80',
  4            wallet_path       => 'file:C:\app\rajam\product\12.1.0\dbhome_1\owm\wallet_51',
  5            wallet_password   => 'aaaaa')
  6    FROM DUAL;

UTL_HTTP.REQUEST(URL=>'HTTPS://WSCTT.abc.COM/CXFWS2/SERVICES/PING',PROXY=
--------------------------------------------------------------------------------
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soapen
v="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><soap:Code>
<soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:la
ng="en">Fault occurred while processing.</soap:Text></soap:Reason></soap:Fault><
/soap:Body></soap:Envelope>


SQL>

No comments:

Post a Comment