mirror of
https://github.com/acme-dns/acme-dns.git
synced 2026-04-27 12:55:48 +03:00
[GH-ISSUE #13] No JSON object could be decoded #3
Labels
No labels
Documentation
Documentation
bug
enhancement
feature request
feature request
help wanted
pull-request
question
security
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/acme-dns#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @eknori on GitHub (Sep 11, 2017).
Original GitHub issue: https://github.com/acme-dns/acme-dns/issues/13
I have put acme-dns into a Docker container with exposed ports 53 and 443. I get response for requests on 53/UDP but I get no response on 443/TCP. All I get is "No JSON object could be decoded"
I have the following (DEFAULT) settings in the api section of config.cfg
Any hint, where to look into?
@joohoi commented on GitHub (Sep 11, 2017):
Unfortunately I'm unavailable to reproduce the problem. Could you post the HTTP request you are sending in?
Does this work:
curl -X GET http://your-container-ip:443/registerhow about:
curl -X POST http://your-container-ip:443/register --data '{"allowfrom": ["127.0.0.1/32"]}'@eknori commented on GitHub (Sep 11, 2017):
I have tried a couple of POST /GET but no success
`root@docker ~]# curl -s -X POST https://eknori.blogsite.org:443/register |python -m json.tool
No JSON object could be decoded
[root@docker ~]# curl -s -X POST https://eknori.blogsite.org/register |python -m json.tool
No JSON object could be decoded
[root@docker ~]# curl -s -X POST https://192.168.178.137/register |python -m json.tool
No JSON object could be decoded
[root@docker ~]# curl -s -X POST https://192.168.178.137:443/register |python -m json.tool
No JSON object could be decoded
[root@docker ~]# curl -s -X POST https://192.168.178.137:443/register --data '{"allowfrom": ["127.0.0.1/32"]}' |python -m json.tool
No JSON object could be decoded
[root@docker ~]# curl -s -X POST https://192.168.178.137:443/register --data '{"allowfrom": ["127.0.0.1/32"]}'
[root@docker ~]# curl -X POST https://192.168.178.137:443/register --data '{"allowfrom": ["127.0.0.1/32"]}'
curl: (35) SSL received a record that exceeded the maximum permissible length.
[root@docker ~]# curl -X GET https://192.168.178.137:443/register --data '{"allowfrom": ["127.0.0.1/32"]}'
curl: (35) SSL received a record that exceeded the maximum permissible length.
[root@docker ~]# curl -X POST https://eknori.blogsite.org/register |python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 167 100 167 0 0 826 0 --:--:-- --:--:-- --:--:-- 830
No JSON object could be decoded
[root@docker ~]# curl -X GET https://eknori.blogsite.org/register |python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 159 100 159 0 0 1121 0 --:--:-- --:--:-- --:--:-- 1127
No JSON object could be decoded
[root@docker ~]# `
@joohoi commented on GitHub (Sep 11, 2017):
Ah, I see. The "No JSON object could be decoded" - message is printed by Python, indicating that it recieved anything but a JSON object. To help with debugging, try leaving the |python -m json.tool out, all it does is pretty printing after all.
What comes to the underlying error, I guess curl tries to communicate with acme-dns using HTTPS, but acme-dns configuration value means that it speaks plain HTTP:
I suggest testing it out with:
curl -X POST http://eknori.blogsite.org:443/registernote http substitution in the protocol part of the URL.
@eknori commented on GitHub (Sep 11, 2017):
sorry, does not work either. I have also tried with port 80 exposed, but it gives me
curl: (7) Failed connect to 192.168.178.137:80; Connection refused
So, I think, that I'l have to create a self signed cert and retry with that.
what I got from my latest tests is
`[root@docker ~]# curl -X POST https://eknori.blogsite.org/register
<HTML><HEAD></HEAD>Http Status Code: 404
Reason: Unable to process request, resource not found
</HTML>[root @docker ~]# curl -X POST https://eknori.blogsite.org/register <HTML><HEAD></HEAD>Http Status Code: 404
Reason: Unable to process request, resource not found
</HTML>[root @docker ~]# curl -X GET https://eknori.blogsite.org/register <HTML><HEAD></HEAD>Http Status Code: 404
Reason: File not found or unable to read file
</HTML>[root@docker ~]# curl -X POST http://eknori.blogsite.org:443/register curl: (52) Empty reply from server`Looks like acme-dns is looking for the files in /etc/tls but cannot find any.
@joohoi commented on GitHub (Sep 11, 2017):
Unfortunately this looks like some other service answering the requests, you might be able to get more information from the HTTP headers by adding -v (verbose) parameter to curl command line.
acme-dns doesn't give HTTP answers (
@eknori commented on GitHub (Sep 11, 2017):
Bummer. Yes. Need to use the IP because blogsite.org is pointing to another server
Now I get
`curl: (35) SSL received a record that exceeded the maximum permissible length.
[root@docker dns]# curl -v -X POST https://192.168.178.137:443/register
CApath: none
curl: (35) SSL received a record that exceeded the maximum permissible length.`
@joohoi commented on GitHub (Sep 11, 2017):
Check my comment https://github.com/joohoi/acme-dns/issues/13#issuecomment-328542535 the issue is that you have configured acme-dns to talk plain HTTP but curl assumes HTTPS, because of https:// - part in the URL. Should work fine with http://yourip:443/register
Naturally either enabling TLS or moving to another port would be a bit less confusing :)
@eknori commented on GitHub (Sep 11, 2017):
AHHHHH. Got it
`curl -v -X POST http://192.168.178.137:443/register
< HTTP/1.1 201 Created
< Content-Type: application/json; charset=UTF-8
< Vary: Origin
< Date: Mon, 11 Sep 2017 16:00:32 GMT
< Content-Length: 243
<
{"allowfrom":[],"fulldomain":"935a8902-cf96-4a65-90b6-132076192af0.eknori.blogsite.org","password":"zWEhjPvYHC0rZffY3NFqZYuAugF9DWwpnfMT2_Sh","subdomain":"935a8902-cf96-4a6
5-90b6-132076192af0","username":"5c50d03f-71c5-49a5-bba5-c48ba5a1a9ad"}[root@docker dns]# `
@joohoi commented on GitHub (Sep 11, 2017):
Closing the issue as resolved. If you run into other problems while installing, feel free to open new issue!