apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

Now add SSL certificate to dasboard of master branch and report the following error

Open tiger333777 opened this issue 6 years ago • 6 comments

360截图16230310112138109

{"app":"manager-api","level":"error","line":"service/ssl.go:421","msg":"status: 400, body: {"error_msg":"invalid configuration: property \"sni\" is required"}\n","time":"2020-07-13T19:04:22+08:00"} {"app":"manager-api","level":"error","line":"route/consumer.go:54","msg":"TraceId: , Code: 010402, Msg: Failed to create APISIX SSL, Detail: status: 400, body: {"error_msg":"invalid configuration: property \"sni\" is required"}\n","requestId":"9e5807a3-7bca-4029-a953-5b91044e9aa7","time":"2020-07-13T19:04:22+08:00"}

AdYb1Jgt0oacao2d/RwjxwElObtAj1lK+bRWri\nKvff39u7zf8AeLO73KxHLENkGrQ4ecKql17n5gJEWTvRFOBnXJmF7aGkcMqkaMXq\nvFEtusiYLLjiwhLPMxkfX6vKMQWqhK6SD/pwcjMCgYEAyy2mI4gXkEtkfDYbcplP\nYgDiLdAzXNvx6bajwJq8Pg/Y4PYxrnc9tszlJODdEtvkmFd494JLptmVk30SESJw\nLjMlk/GebSswU5W6uV4Fa2ukiyQecDCQZY9+PMIVd3oLE6N6JUCW0x/jcoaloUwQ\nAkzgrTV2aPkih/CYuIfhnZcCgYA/R73m6oSLnfhRLM+YRn542W7kI1OJRVY2hTo4\n+i/dLiWacxCErmG6ILRqG/axx45QfoqdXlDpFTEsR9tqE3ISo8GqU3N+QO0OtvLN\np3HRgxzfvkCzAuL44vaH+6imGckZdDmU/R4V+Tx5sZDx1N9w+5A0jNR6G4G/OO2G\nP/peqQKBgCtBJzMGaBCedKmfDVKIyktA/i2rOvtnTJ2mazEKXszfh15ZgQOC/U4I\nMu2BLX3p7XRY48neuuUj5XNW5KWeHU7cx2nxBQNQME0h6RX0ZlgNDi5nriQFDiqg\n4ivN6ajtIxpEmcKyMD3ldhHl4LMfniOUb5U4LI1owzz1IIV/CepI\n-----END RSA PRIVATE KEY-----\n"}","path":"/apisix/admin/ssls","remoteIp":"192.168.31.171","requestId":"9e5807a3-7bca-4029-a953-5b91044e9aa7","respBody":"{"code":"010402","msg":"Failed to create APISIX SSL"}","statusCode":500,"time":"2020-07-13T19:04:22+08:00"}

tiger333777 avatar Jul 13 '20 11:07 tiger333777

property \"sni\" is required"}\n","

Hi, could you please paste your request body here?(key & cert could use *** instead).

juzhiyuan avatar Jul 13 '20 11:07 juzhiyuan

(/root/go/src/github.com/apisix/manager-api/service/ssl.go:227) [2020-07-13 19:29:26] [1.59ms] INSERT INTO ssls (id,create_time,update_time,validity_start,validity_end,snis,status,public_key,public_key_hash) VALUES ('025eec71-7f43-4234-833c-8496afdd94f2',1594639766,1594639766,1560843085,1624001485,'[".y..com","y.*.com"]',1,'-----BEGIN CERTIFICATE-----


-----END CERTIFICATE----- -----BEGIN CERTIFICATE-----


-----END CERTIFICATE-----','19976900bbe57babe7dad87eb7532b7a')
[1 rows affected or returned ] {"app":"manager-api","level":"error","line":"service/ssl.go:419","msg":"http://127.0.0.1/apisix/admin/ssl/025eec71-7f43-4234-833c-8496afdd94f2","time":"2020-07-13T19:29:26+08:00"} {"app":"manager-api","level":"error","line":"service/ssl.go:420","msg":"{"cert":"-----BEGIN CERTIFICATE-----\r\-----END RSA PRIVATE KEY-----","snis":[".y..com","y..com"]}","time":"2020-07-13T19:29:26+08:00"} {"app":"manager-api","level":"error","line":"service/ssl.go:421","msg":"status: 400, body: {"error_msg":"invalid configuration: property \"sni\" is required"}\n","time":"2020-07-13T19:29:26+08:00"} {"app":"manager-api","level":"error","line":"route/consumer.go:54","msg":"TraceId: , Code: 010402, Msg: Failed to create APISIX SSL, Detail: status: 400, body: {"error_msg":"invalid configuration: property \"sni\" is required"}\n","requestId":"c06287e1-763c-4062-8d07-3cb89a5fc799","time":"2020-07-13T19:29:26+08:00"} {"app":"manager-api","errMsg":null,"host":"172.16.1.115:8080","latency":10,"level":"info","line":"filter/logging.go:73","method":"POST","msg":"","params":"{"cert":"******-----END RSA PRIVATE KEY-----\n"}","path":"/apisix/admin/ssls","remoteIp":"192.168.3.11","requestId":"c06287e1-763c-4062-8d07-3cb89a5fc799","respBody":"{"code":"010402","msg":"Failed to create APISIX SSL"}","statusCode":500,"time":"2020-07-13T19:29:26+08:00"}

tiger333777 avatar Jul 13 '20 13:07 tiger333777

Looks like this request lost the sni information. Could you see this page when you submit your cert?

image

juzhiyuan avatar Jul 13 '20 14:07 juzhiyuan

yes

tiger333777 avatar Jul 13 '20 14:07 tiger333777

🤔 Could you please open your Dev tools on Chrome (F12), and switch to Network section, then do a submit and copy the request as cURL. I need to take a look at your request body sent from your browser.

juzhiyuan avatar Jul 13 '20 15:07 juzhiyuan

i get now apisix upgrade to master branch to solve the problem

tiger333777 avatar Jul 14 '20 08:07 tiger333777