Skip to content

bug: ssl upgrade display :"Invalid date" #2476

@stevenlee87

Description

@stevenlee87

Current Behavior

when i perform python script:

#!/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

bug2

Error Logs

bug1

Steps to Reproduce

when i perform python script:

#!/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions