Results 1 to 9 of 9

Thread: Letsencrypt says connection refused?

  1. #1
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    4,091

    Letsencrypt says connection refused?

    I'm trying to create a ssl certificate for my hostname like state in.

    But this is the result every time:
    [code]Challenge status: invalid. Challenge error: "type": "http-01", "status": "invalid", "error": { "type": "urn:ietfarams:acme:error:connection", "detail": "Fetching http://vps.someserver.nl/.well-known/acme-challenge/6iSIHA9NvESt3QRkqLfCyuQQxJoqIm7F1Nc3yjrhkFc: Connection refused", "status": 400 . Exiting...

    Previously it was complaining about a missing A record. So I created an A record for the hostname.
    When visiting http://vps.someserver.nl it's showing "apache is functioning normally" but indeed a /.well-known/acme-chellenge/6xxxx etc. can not be found.

    It's not a firewall issue, no firewall installed yet, iptables is all open.

    I don't know what's going wrong I always did it this way and never had issues before.
    Greetings, Richard.

  2. #2
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    4,091
    I went a bit further and tried debugging like mentioned here:
    https://help.directadmin.com/item.php?id=646

    But it seems that it is working when using someserver.nl but not when using vps.someserver.nl so it works on domain name, but not on hostname.

    So I tried the curl option mentioned on that page and that looks fine.
    Code:
    /usr/local/bin/curl -I -L -k -X GET http://vps.someserver.nl/.well-known/acme-challenge/test.txt
    HTTP/1.1 200 OK
    Date: Sat, 27 Jul 2019 21:16:29 GMT
    Server: Apache/2
    Last-Modified: Sat, 27 Jul 2019 21:12:05 GMT
    ETag: "5-58eb01c67866e"
    Accept-Ranges: bytes
    Content-Length: 5
    Vary: User-Agent
    Content-Type: text/plain
    But I want to create a certificate for my hostname, which is vps.someserver.nl and it's not working.
    Greetings, Richard.

  3. #3
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    4,091
    Found the cause.

    The provider is changing /etc/hostname every time.

    So I set a kernel hostname, so the hostname is correct, but /etc/hostname is showing a wrong hostname every time.
    I'll look in to how to fix this.

    Edit: Fixed it by changing hostname @reboot in cron.
    Last edited by Richard G; 07-27-2019 at 04:16 PM. Reason: Added solution
    Greetings, Richard.

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,598
    You might need to change the hostname on the server dashboard, it is usually a name of a VPS which you set on a page where you pay for your VPS (stop/restart) etc.
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  5. #5
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    4,091
    Thank you Alex, but that was not possible. Strato does not allow to change the hostname so there is also no option for it on the dashboard.
    My way to fix things was the only way to do it unfortunately.
    Greetings, Richard.

  6. #6
    Join Date
    May 2014
    Location
    Netherlands Germany
    Posts
    536
    Quote Originally Posted by Richard G View Post
    My way to fix things was the only way to do it unfortunately.
    chattr +i resolv.conf


    chattr -i resolv.conf

    or use of chattr with other files they want to change in startup / boot
    DUTCH GERMAN, GERMAN DUTCH

  7. #7
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    4,091
    I already used chattr +i /etc/sysconfig/network beacuse that file was overwritten every time too.

    Indeed I could also have used chattr for the resolve.conf file. Maybe I'm going to change that also.
    Greetings, Richard.

  8. #8
    Join Date
    May 2014
    Location
    Netherlands Germany
    Posts
    536
    YUp or with the files they are changing for hostname. hosts whatever it is / should in.

    https://forum.directadmin.com/showth...725#post201725
    Last edited by ikkeben; 07-29-2019 at 10:26 AM.
    DUTCH GERMAN, GERMAN DUTCH

  9. #9
    Join Date
    Jul 2008
    Location
    Maastricht
    Posts
    4,091
    Yep, I already checked that, but only /etc/hostname and /etc/sysconfig/network got overwritten. So only 2 files needed protection.
    It's just odd that one can not change the hostname via the hoster's dashboard.

    I was mistaken in my previous message and ment /etc/hostname because resolv.conf does not get overwritten. You can disable this in the dashboard that it will be overwritten.
    Greetings, Richard.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •