几个关于ssl的疑问 #7853
Unanswered
Lewisyixin
asked this question in
Q&A
几个关于ssl的疑问
#7853
Replies: 2 comments 2 replies
-
@bzp2010 please take a look |
Beta Was this translation helpful? Give feedback.
0 replies
-
I used the following command to generate the certificate for testing on Windows. openssl genrsa -out root.key 2048
openssl req -new -out root.csr -key root.key
openssl x509 -req -in root.csr -out root.crt -signkey root.key -CAcreateserial -days 3650
openssl genrsa -out server.key 2048
openssl req -new -out server.csr -key server.key
openssl x509 -req -in server.csr -out server.crt -signkey server.key -CA root.crt -CAkey root.key -CAcreateserial -days 3650
openssl genrsa -out client.key 2048
openssl req -new -out client.csr -key client.key
openssl x509 -req -in client.csr -out client.crt -signkey client.key -CA root.crt -CAkey root.key -CAcreateserial -days 3650
openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12 Then, configure certificates for APISIX via the Admin API. curl --location --request PUT 'http://127.0.0.1:9180/apisix/admin/ssls/1' \
--header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
--header 'Content-Type: application/json' \
--data-raw '{
"snis": [
"example.com"
],
"client":{
"ca": "-----BEGIN CERTIFICATE-----\nxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END CERTIFICATE-----"
},
"cert": "-----BEGIN CERTIFICATE-----\nxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END CERTIFICATE-----",
"key": "-----BEGIN RSA PRIVATE KEY-----\nxxxxxxxxxxxxxxxxxxxxxxxxxx\n-----END RSA PRIVATE KEY-----"
}' I'm not sure why your Python program is accessing curl --cert ./client.crt --key ./client.key https://example.com:9443 -k -v You can test it by following the steps above.
Please help point out if I am wrong. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
搜了下文档,apisix中关于ssl相关的文档很少,今天在尝试配置客户端证书的时候发现了一些问题。
apisix使用客户端证书有没有请求例子可以参考下?我们将正在使用的nginx的客户端pem文件传入apisix的ssl证书配置中无法正常访问,不知道是不是传的格式有问题。

客户端证书传入的数据格式类似下面这样,传入位置应该是正确的,因为加上这个之后,再次直接请求https域名会被限制
"client":{"depth":1,"ca":"-----BEGIN CERTIFICATE-----\nxxxxxxxxxxxxxxxxx\n-----END CERTIFICATE-----\n"}
但是按照和之前同样的python程序访问会报下面这样的错误
apisix的客户端证书是放到和服务端证书相同的配置当中的,通常来讲一个apisix实例会运行多个二级域名相同的域名,所以当我想给其中一个域名配置客户端证书,其余不配置的时候,如何实现?
Beta Was this translation helpful? Give feedback.
All reactions