目前ohs服務器上已有自簽名證書,客戶購買了第三方證書要求把自簽名換成第三方證書,客戶提供證書以下:apache
一開始想固然用for Apache裏面的證書,由於ohs前身就是apache,這也是全部坑的開始。
證書製做過程很順利,但在重啓服務器時報如下錯誤:服務器
*** glibc detected *** /u01/app/Oracle/Middleware/Oracle_WT1/ohs/bin/httpd.worker: free(): invalid pointer: 0x000000000c6ce1f0 *** ======= Backtrace: ========= /lib64/libc.so.6[0x3de6c7230f] /lib64/libc.so.6(cfree+0x4b)[0x3de6c7276b] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nzumfree+0x64)[0x2b707d26b876] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nztiFIC_Free_Identity_Contents+0x45)[0x2b707d29adef] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nztiDI_Destroy_Identity+0x3a)[0x2b707d29ad84] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nztiFIL_Free_Identity_List+0x5a)[0x2b707d29ad36] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nztnFPC_Free_Persona_Contents+0x45)[0x2b707d29ecb5] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nztnDAP_Destroy_A_Persona+0x41)[0x2b707d29ec51] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nztnFPL_Free_Persona_List+0x56)[0x2b707d29ec00] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nztwFWC_Free_Wallet_Contents+0x70)[0x2b707d2a12e6] /u01/app/Oracle/Middleware/Oracle_WT1/lib/libnnz11.so(nzos_OpenWallet+0x3d)[0x2b707d2b0071] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/modules/mod_ossl.so[0x2b70800adeff] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/modules/mod_ossl.so(is_sso_wallet+0x1a)[0x2b70800ae010] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/modules/mod_ossl.so[0x2b70800ae4a2] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/modules/mod_ossl.so(ssl_pphrase_Handle+0x13d)[0x2b70800af075] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/modules/mod_ossl.so(ssl_init_Module+0x229)[0x2b70800a5deb] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/bin/httpd.worker(ap_run_post_config+0xc8)[0x44fcd0] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/bin/httpd.worker(main+0x10ad)[0x42debf] /lib64/libc.so.6(__libc_start_main+0xf4)[0x3de6c1d994] /u01/app/Oracle/Middleware/Oracle_WT1/ohs/bin/httpd.worker(apr_bucket_mmap_make+0x5a)[0x426bea]
目測沒法解決,google和sr上也沒有好的解決方案。
由於一直死磕apache,幾乎絕望,懷疑證書問題,想到客戶證書是Wosign公司簽發的,就去wosign的官網,在官網上發現了這張圖片,才忽然意識到apache文件夾裏沒有中間證書,巨坑啊。oracle
至此放棄apache選擇other server。app
開始介紹正常正如何導入ohs。編輯器
ca.crt
。保留標識符「-----BEGIN CERTIFICATE-----「
和」-----END CERTIFICATE-----「
,合併後的文件格式以下:-----BEGIN CERTIFICATE----- ..... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- ..... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- ..... -----END CERTIFICATE-----
server.key
,用戶文件server.crt
,第1步合併後的ca.crt
上傳到ohs服務器。-rw-r--r-- 1 oracle oinstall 4503 Jun 8 01:51 ca.crt -rwxr-xr-x 1 oracle oinstall 2061 Jun 8 01:50 server.crt -rwxr-xr-x 1 oracle oinstall 1700 Jun 8 01:50 server.key
openssl pkcs12 -export -in server.crt -inkey server.key -certfile ca.crt -out ewallet.p12
openssl會要求輸入密碼,該密碼不能爲空,命令執行完後會生成ewallet.p12文件
對於第三方證書,ohs目前只支持這種類型,而且生成的文件名ewallet.p12也不能修改工具
該工具位於$MW_HOME/Oracle_WT1/bin/owm
,如/u01/app/Oracle/Middleware/Oracle_WT1/bin/owm
啓動後點擊菜單Wallet->Open,會詢問是否繼續,選擇YES後選擇包含ewallet.p12的文件夾,輸入第3步所指定的密碼。post
選擇菜單wallet,把Auto Login勾選上,保存退出ui
此時ewallet.p12
所在的文件夾下會多出一個文件cwallet.sso
google
-rw-r--r-- 1 oracle oinstall 4503 Jun 8 01:51 ca.crt -rw------- 1 oracle oinstall 6453 Jun 8 02:05 cwallet.sso -rw------- 1 oracle oinstall 6421 Jun 8 02:05 ewallet.p12 -rwxr-xr-x 1 oracle oinstall 2061 Jun 8 01:50 server.crt -rwxr-xr-x 1 oracle oinstall 1700 Jun 8 01:50 server.key
cwallet.sso
和ewallet.p12
兩個文件到demo
文件夾下將spa
SSLWallet "${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/keyss tores/default"
修改成
SSLWallet "${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/keyss tores/demo"
保存退出,重啓ohs服務器,訪問https://host:4443
驗證證書是否導入成功,至於如何將4443端口修改成默認的443端口,後面再說,也是一件麻煩的事。
之因此折騰到這麼晚,總結了一下緣由:
2017-06-15 oracle ohs修改https端口