自签名证书码头

时间:2016-02-23 16:34:35

标签: ssl https openssl jetty cas

我正在使用Jetty服务器来运行CAS(http://jasig.github.io/cas/4.1.x/index.html)。   为了启用ssl支持,我使用以下命令生成证书:

openssl genrsa -des3 -out jetty.key
openssl req -new -x509 -key jetty.key -out jetty.crt
keytool -keystore keystore -import -alias jetty -file jetty.crt -trustcacerts
openssl req -new -key jetty.key -out jetty.csr
openssl pkcs12 -inkey jetty.key -in jetty.crt -export -out jetty.pkcs12
keytool -importkeystore -srckeystore jetty.pkcs12 -srcstoretype PKCS12 -destkeystore keystore

然后,在etc/jetty-ssl.xml中设置我的.crt文件。

然而,尝试在PHP应用程序上使用CAS我被SSL问题禁止。

由于我的证书是自签名的,如何将其添加为安全证书?

先谢谢。

修改

我运行curl:curl -v "https ://mydomain.org/myapp/myservice"

输出结果为:

* About to connect() to mydomain.com port 443 (#0)
*   Trying myip... connected
* Connected to mydomain.com (myip) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Certificate is signed by an untrusted issuer: 'CN=mycn,O=myo,L=myl,ST=myst,C=myc'
* NSS error -8172
* Closing connection #0
* Peer certificate cannot be authenticated with known CA certificates
curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

我知道这是因为证书是自签名的,但我想知道是否有办法在我的开发环境中忽略它。

修改2

错误CURL error #35: Encountered end of file有意义吗?

0 个答案:

没有答案