【发布时间】:2020-11-11 05:20:14
【问题描述】:
我尝试在本地设置 ALLINONE,遵循文档 https://apim.docs.wso2.com/en/latest/learn/api-security/api-authentication/secure-apis-using-mutual-ssl/ 它起作用了,但是请求的 curl 命令是什么,因为文档只讨论通过邮递员进行测试
【问题讨论】:
我尝试在本地设置 ALLINONE,遵循文档 https://apim.docs.wso2.com/en/latest/learn/api-security/api-authentication/secure-apis-using-mutual-ssl/ 它起作用了,但是请求的 curl 命令是什么,因为文档只讨论通过邮递员进行测试
【问题讨论】:
当您想使用基于标头的方法时,可以使用以下 curl 命令。
curl -X GET -H "X-WSO2-CLIENT-CERTIFICATE: (Base64 encoded public cert)" "https://localhost:8243/mock/v1" -v
curl -X GET -H "X-WSO2-CLIENT-CERTIFICATE: (Base64 encoded public cert)" "http://localhost:8280/mock/v1" -v
为了实现这一点,您需要在 wso2am-3.2.0/repository/conf 位置的 deployment.toml 中添加以下配置。
[apimgt.mutual_ssl]
enable_client_validation = false
如果您使用证书和密钥,则可以使用以下 curl 命令。
curl -k --cert int.ext.wso2.com.crt --key int.ext.wso2.com.key -X GET "https://localhost:8243/mock/v1" -v
【讨论】: