Thursday, May 2, 2019

Installing Certificates in Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 using orapki

[oracle@ODIGettingStarted ~]$ sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 2 02:09:32 2019

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

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT UTL_HTTP.request ('https://demo.proctoru.com/api/',NULL,NULL,NULL) FROM DUAL;
SELECT UTL_HTTP.request ('https://demo.proctoru.com/api/',NULL,NULL,NULL) FROM DUAL
       *
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1720
ORA-29024: Certificate validation failure
ORA-06512: at line 1


SQL>

[oracle@ODIGettingStarted ~]$ pwd
/home/oracle
[oracle@ODIGettingStarted ~]$ cd /u01/app/oracle/product/11.2.0/orcl/owm
[oracle@ODIGettingStarted owm]$ mkdir proctoru_sbox
[oracle@ODIGettingStarted owm]$ cd proctoru_sbox
[oracle@ODIGettingStarted proctoru_sbox]$ ls -ltr
total 0
[oracle@ODIGettingStarted proctoru_sbox]$ pwd
/u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox
[oracle@ODIGettingStarted proctoru_sbox]$ mv /home/oracle/Downloads/StarfieldRootCertificateAuthority-G2.crt /u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox/
[oracle@ODIGettingStarted proctoru_sbox]$ mv /home/oracle/Downloads/StarfieldSecureCertificateAuthority-G2.crt /u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox/
[oracle@ODIGettingStarted proctoru_sbox]$ ls -ltr
total 8
-rw-rw-r--. 1 oracle oracle 1822 May  2 02:10 StarfieldSecureCertificateAuthority-G2.crt
-rw-rw-r--. 1 oracle oracle 1422 May  2 02:10 StarfieldRootCertificateAuthority-G2.crt
[oracle@ODIGettingStarted proctoru_sbox]$ orapki wallet create -wallet . -pwd welcome123 -auto_login
Oracle PKI Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

[oracle@ODIGettingStarted proctoru_sbox]$ orapki wallet display -wallet . -pwd c269065d96de5de8ca8264773eebe1
Oracle PKI Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

Found Auto Login (AL) wallet.
Option -pwd is not recognized and ignored.
Requested Certificates:
User Certificates:
Trusted Certificates:
Subject:        OU=Class 1 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        OU=Class 3 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        OU=Class 2 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        OU=Secure Server Certification Authority,O=RSA Data Security\, Inc.,C=US
Subject:        CN=GTE CyberTrust Global Root,OU=GTE CyberTrust Solutions\, Inc.,O=GTE Corporation,C=US
[oracle@ODIGettingStarted proctoru_sbox]$ orapki wallet add -wallet . -pwd welcome123 -trusted_cert -cert StarfieldRootCertificateAuthority-G2.crt
Oracle PKI Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

[oracle@ODIGettingStarted proctoru_sbox]$ orapki wallet add -wallet . -pwd welcome123 -trusted_cert -cert StarfieldSecureCertificateAuthority-G2.crt
Oracle PKI Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

[oracle@ODIGettingStarted proctoru_sbox]$ orapki wallet display -wallet . -pwd welcome123
Oracle PKI Tool : Version 11.2.0.4.0 - Production
Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.

Requested Certificates:
User Certificates:
Trusted Certificates:
Subject:        OU=Class 3 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        CN=Starfield Root Certificate Authority - G2,O=Starfield Technologies\, Inc.,L=Scottsdale,ST=Arizona,C=US
Subject:        CN=GTE CyberTrust Global Root,OU=GTE CyberTrust Solutions\, Inc.,O=GTE Corporation,C=US
Subject:        CN=Starfield Secure Certificate Authority - G2,OU=http://certs.starfieldtech.com/repository/,O=Starfield Technologies\, Inc.,L=Scottsdale,ST=Arizona,C=US
Subject:        OU=Class 2 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        OU=Class 1 Public Primary Certification Authority,O=VeriSign\, Inc.,C=US
Subject:        OU=Secure Server Certification Authority,O=RSA Data Security\, Inc.,C=US
[oracle@ODIGettingStarted proctoru_sbox]$ ls -ltr
total 24
-rw-rw-r--. 1 oracle oracle 1822 May  2 02:10 StarfieldSecureCertificateAuthority-G2.crt
-rw-rw-r--. 1 oracle oracle 1422 May  2 02:10 StarfieldRootCertificateAuthority-G2.crt
-rw-------. 1 oracle oracle 5960 May  2 02:25 ewallet.p12
-rw-------. 1 oracle oracle 6037 May  2 02:25 cwallet.sso
[oracle@ODIGettingStarted proctoru_sbox]$ pwd
/u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox
[oracle@ODIGettingStarted proctoru_sbox]$
[oracle@ODIGettingStarted proctoru_sbox]$ sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 2 02:32:58 2019

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

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT UTL_HTTP.request ('https://demo.proctoru.com/api/',NULL,'file:/u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox','') FROM DUAL;

UTL_HTTP.REQUEST('HTTPS://DEMO.PROCTORU.COM/API/',NULL,'FILE:/U01/APP/ORACLE/PRO
--------------------------------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta content='IE=edge' http-equiv='X-UA-Compatible'>
<meta content='width=device-width, initial-scale=1' name='viewport'>
<link rel="shortcut icon" type="image/x-icon" href="https://assets-demo.proctoru
.com/assets/meta/favicon-32x32-facc4a9f835655772abef063786bd570d1b3b8fc494eea220
8abb4e85a98f180.png" sizes="32x32" />
<link rel="shortcut icon" type="image/x-icon" href="https://assets-demo.proctoru
.com/assets/meta/favicon-16x16-662172a770cbd3817731ddb46880a4e731672842f5ae4d3a4

UTL_HTTP.REQUEST('HTTPS://DEMO.PROCTORU.COM/API/',NULL,'FILE:/U01/APP/ORACLE/PRO
--------------------------------------------------------------------------------
af9b3d880b4278f.png" sizes="16x16" />
<link rel="apple-touch-icon" type="image/png" href="https://assets-demo.proctoru
.com/assets/meta/touch-icon-57x57-bb97d27e2c44dbd5b84c117542bf28eee1e6af2c153efc
2b8d806681533f0d67.png" sizes="57x57" />
<link rel="apple-touch-icon" type="image/png" href="https://assets-demo.proctoru
.com/assets/meta/touch-icon-76x76-70d3a48fb797b33bce31027cc70f4d47e4a0382293f2aa
caf192ec81d538b779.png" sizes="76x76" />
<link rel="apple-touch-icon" type="image/png" href="https://assets-demo.proctoru
.com/assets/meta/touch-icon-120x120-9ba7d4cca27e9f135b1467c98fad559b72ec06f68256
cc6dbfc5d43ab3de54b5.png" sizes="120x120" />
<link rel="apple-touch-icon" type="image/png" href="https://assets-demo.proctoru

UTL_HTTP.REQUEST('HTTPS://DEMO.PROCTORU.COM/API/',NULL,'FILE:/U01/APP/ORACLE/PRO
--------------------------------------------------------------------------------
.com/assets/meta/touch-icon-152x152-f643fffcb751d22dceaa9a675cf97fdf7e1ccac9b85c
3a87afe46fc019f16356.png" sizes="152x152" />
<link rel="apple-touch-icon" type="image/png" href="https://assets-demo.proctoru
.com/assets/meta/touch-icon-180x180-515c36dd490fd322b035b2a0ee04613ef22565652dc4
2213a31332d4f7f447c3.png" sizes="180x180" />
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="q1SAdLLChG5/NIKJ0oETvVf144/wr8QVKV51DqRcRVZsIDv
9OYJQeQLWo18/dlz31sWMozI4tv42c7E/86rlVg==" />
<meta name="action-cable-url" content="/cable" />

<meta content='no-cache' name='turbolinks-cache-control'>

UTL_HTTP.REQUEST('HTTPS://DEMO.PROCTORU.COM/API/',NULL,'FILE:/U01/APP/ORACLE/PRO
--------------------------------------------------------------------------------

<title>Sorry, the page you were looking for doesn&#39;t exist (404) | ProctorU</
title>
<link rel="stylesheet" media="al


SQL>

"*****************************************************

[oracle@ODIGettingStarted ~]$ sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 2 02:09:32 2019

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

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create user scott identified by tiger;

User created.

SQL> grant connect,resource to scott;

Grant succeeded.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ODIGettingStarted proctoru_sbox]$ sqlplus scott/tiger

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 2 02:36:52 2019

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT UTL_HTTP.request ('https://demo.proctoru.com/api/',NULL,'file:/u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox','') FROM DUAL;
SELECT UTL_HTTP.request ('https://demo.proctoru.com/api/',NULL,'file:/u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox','') FROM DUAL
       *
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1720
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at line 1


SQL> exit


[oracle@ODIGettingStarted ~]$ pwd
/home/oracle
[oracle@ODIGettingStarted ~]$ sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 2 02:46:54 2019

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

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> --use-passwords

BEGIN
   DBMS_NETWORK_ACL_ADMIN.create_acl (
      acl           => 'proctoru.xml',
      description   => 'to access proctoru_sbox wallet using scott user',
      principal     => 'SCOTT',
      is_grant      => TRUE,
      privilege     => 'use-client-certificates',
      start_date    => NULL,
      end_date      => NULL);
   COMMIT;
END;
/SQL> SQL>   2    3    4    5    6    7    8    9   10   11   12

PL/SQL procedure successfully completed.

SQL> BEGIN
   DBMS_NETWORK_ACL_ADMIN.assign_wallet_acl (
      acl           => 'proctoru.xml',
      wallet_path   => 'file:/u01/app/oracle/product/11.2.0/orcl/owm/proctoru_sbox');
   COMMIT;
END;
/  2    3    4    5    6    7

PL/SQL procedure successfully completed.

SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ODIGettingStarted ~]$ sqlplus scott/tiger

SQL*Plus: Release 11.2.0.4.0 Production on Thu May 2 02:48:07 2019

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

No comments:

Post a Comment