stevenlee87 opened a new issue, #2476:
URL: https://github.com/apache/apisix-dashboard/issues/2476
### Current Behavior
when i perform python script:
```python
#!/usr/bin/python3
# coding: utf-8
# save this file as test-ssl.py
import sys
# sudo pip install requests
import requests
if len(sys.argv) <= 3:
print("bad argument")
sys.exit(1)
with open(sys.argv[1]) as f:
cert = f.read()
with open(sys.argv[2]) as f:
key = f.read()
sni = sys.argv[3]
api_key = "edd1c9f034335f136f87ad84b625c8f1"
resp = requests.put("http://127.0.0.1:9080/apisix/admin/ssl/10", json={
"cert": cert,
"key": key,
"snis": [sni],
}, headers={
"X-API-KEY": api_key,
})
print(resp.status_code)
print(resp.text)
```
./test-ssl.py t.crt t.key imepisode.top
output:
201
{"node":{"key":"\/apisix\/ssl\/10","value":{"cert":"-----BEGIN
CERTIFICATE----- 。。。。
### Expected Behavior
The certificate displays the normal expiration time

### Error Logs

### Steps to Reproduce
when i perform python script:
```python
#!/usr/bin/python3
# coding: utf-8
# save this file as test-ssl.py
import sys
# sudo pip install requests
import requests
if len(sys.argv) <= 3:
print("bad argument")
sys.exit(1)
with open(sys.argv[1]) as f:
cert = f.read()
with open(sys.argv[2]) as f:
key = f.read()
sni = sys.argv[3]
api_key = "edd1c9f034335f136f87ad84b625c8f1"
resp = requests.put("http://127.0.0.1:9080/apisix/admin/ssl/10", json={
"cert": cert,
"key": key,
"snis": [sni],
}, headers={
"X-API-KEY": api_key,
})
print(resp.status_code)
print(resp.text)
```
./test-ssl.py t.crt t.key imepisode.top
output:
201
{"node":{"key":"\/apisix\/ssl\/10","value":{"cert":"-----BEGIN
CERTIFICATE----- 。。。。
### Environment
docker images
REPOSITORY TAG IMAGE ID
CREATED SIZE
docker.io/apache/apisix 2.14.0-alpine 725ef9bd333b
2 days ago 148 MB
docker.io/apache/apisix-dashboard 2.10.1-alpine d62bd8aeb867
2 months ago 109 MB
docker.io/bitnami/etcd 3.4.15 8c7e00e786b8
12 months ago 132 MB
docker.io/prom/prometheus v2.25.0 a618f5685492
15 months ago 175 MB
docker.io/grafana/grafana 7.3.7 13afb861111c
16 months ago 187 MB
docker.io/nginx 1.19.0-alpine 7d0cdcc60a96
24 months ago 21.3 MB
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]