Prajithp / letsencrypt-cpanel

cPanel/WHM plugin for Let's Encrypt client
MIT License
179 stars 61 forks source link

HTTP-01 error #71

Closed uhlhosting closed 7 years ago

uhlhosting commented 8 years ago

Error occurred: Status: invalid, Detail: , Type: http-01

Prajithp commented 8 years ago

When did you install this? Could you please try a reinstall and let me know?

uhlhosting commented 8 years ago

Another issue, icon not visible on Cpanel 58. http://prntscr.com/bsowyp

I uninstalled / reinstalled

Now I get this: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "Could not connect to...") at /usr/local/cpanel/base/3rdparty/letsencrypt-cpanel-ui/lib/perl5/Protocol/ACME.pm line 1044.

Unyxos commented 8 years ago

Have the same issue on a domain and it works with another one, both have same settings on my cPanel

timdelange commented 8 years ago

I'm also getting Error occurred: Status: invalid, Detail: , Type: http-01 CLOUDLINUX 6.8 x86_64 standard WHM 56.0 (build 25)

Reinstall made no difference

Prajithp commented 8 years ago

@highacid are you also using cloudlinux? just wanted to know.

timdelange commented 8 years ago

I was able to do it manually using certbot --manual, creating the challenge file by hand in the home directory. Also, like @Unyxos the script succeeded for some of my other domains.

uhlhosting commented 8 years ago

@Prajithp I use simple Centos 7, I was on cloudlinux, but moved back to Centos 7.

tsisson1 commented 8 years ago

@Prajithp I'm getting the same issue on a CentOS 6.7 install. I have it working great on CentOS 6.8 server I have with InMotion. But my CentOS 6.7 server is throwing the error when I go to create an SSL in cPanel. Are there log files somewhere to view on why its failing?

ajwilco commented 8 years ago

^ I'm having the same issue. Installed your plugin yesterday on a new CentOS 6.8 server, and getting "Error occurred: Status: invalid, Detail: , Type: http-01" when attempting to add a certificate to an addon domain, whether I attempt from WHM or cPanel. Though it installed certs on all WHM services fine.

I've been using the plugin on an older server that's also running CentOS 6.8 for a few months now without any trouble. I installed a cert on a domain on that server today just to make sure it still could. Any help would be appreciated, I wasn't able to locate an error log either. Until now the plugin has been fantastic. Thanks!

3by400 commented 8 years ago

We have the same issue. CentOS 6.8, WHM 56.0 (build 25) Works beautifully for two out of four subdomains, for two others I get Error occurred: Status: invalid, Detail: , Type: http-01

The procedure creates the .well-known/acme-challenge directory and the authorization file, and that file is world-readable.

Any help would be appreciated.

Edit to add: We uninstalled and reinstalled the plugin and are experiencing the same behavior. Same behavior in cPanel and in WHM.

The plugin is creating the following files in /var/letsencrypt/live/sudbomain.domain.com .csr .key These files are not being created: .crt .ca _tmpca.der _tmpcert.der

[SOLVED] - the domains that did not go through only had subdomain.domain.com in DNS. The ones that worked had both subdomain.domain.com and www.subdomain.domain.com as A records.

cPanel creating the www subdomain is mentioned in Issue #44 but I missed it in my search. I hope this helps anyone with the same issue.

tsisson1 commented 8 years ago

@Prajithp UPDATE: so it works on newly created subdomains and cPanel accounts. However, I can't seen to get it to work on the primary domain. I removed all the files from the doc root and made sure to rename .htaccess files. It still throws the same error. On a few of the subdomains, the htaccess file had redirects which stopped the cert from validating. Once we renamed the htaccess, it corrected the issue. Any more information you can provide would be greatly appreciated.

santiazpi commented 8 years ago

For whoever is interested, my http-01 issue was resolved with the read me .htaccess fix adding to .htaccess file: RewriteRule ^.well-known(.*)$ - [L,NC]

Mastergalen commented 8 years ago

Same problem on CENTOS 6.8 x86_64 kvm – WHM 56.0 (build 29).

The challenge file is created and it's served to the browser when accessing domain.com/.well-known/acme-challenge/Rl3e7Qwip5NRrZWA9RChbevqC73Fe6jS0oJPXilT79U

It worked for securing the WHM domain and my main domain, not for addon domains, however.

muratyamac commented 8 years ago

I am having Error occurred: Status: invalid, Detail: , Type: http-01 too but i found out something strange regarding it. I can install to a domain without a problem, i can even install to a subdomain without a problem. I can't install to subdomain if the root domain has a ssl certificate. I have tried it with few different domains from different provider i always get this error.

uhlhosting commented 8 years ago

It seems we are ignored all... There is one reply only from the developer...

BeZazz commented 8 years ago

2 replies actually.

Maybe you should ask for a refund...

WilliamIsted commented 8 years ago

@highacid Out of interest, what are the domains that you're having trouble with? And is it all domains or only some?

MouseEatsCat commented 8 years ago

I'm experiencing the same issue with cPanel accounts that have subdomains and addon domains along with the primary domain name. The error i'm receiving is this (some of it is removed using **** in order to protect privacy):

'token' => '*********',
'type' => 'http-01',
'error' => {
    'status' => 400,
    'type' => 'urn:acme:error:connection',
    'detail' => 'Could not connect to http://www.website.com/.well-known/acme-challenge/*************'
},
'uri' => 'https://acme-v01.api.letsencrypt.org/acme/challenge/*********/*********',
'detail' => '',
'validationRecord' => [ {
    'hostname' => 'www.website.com',
    'addressesResolved' => [ '***.***.***.227' ],
    'addressUsed' => '***.***.***.227',
    'url' => 'http://www.website.com/.well-known/acme-challenge/*************',
    'port' => '80'
}],
'status' => 'invalid',
'keyAuthorization' => '*********.*********' },
'Protocol::ACME::Exception' );

I have tested the url to the acme-challenge file and can confirm that it is publicly accessible.

WilliamIsted commented 8 years ago

@MouseEatsCat have you tried the RewriteRule ^.well-known(.*)$ - [L,NC] in the top of .htaccess within the document root for the domains? Can you supply the domain(s) that you are having trouble with, I would like to troubleshoot the issue using a domain that is experiencing the issue.

MouseEatsCat commented 8 years ago

@WilliamIsted I had included that line to my .htaccess file previously but it did not fix anything. Since then however, I removed a Domain Alias from within cPanel that wasn't being used (email.website.com). Afterwards, I re-added RewriteRule ^.well-known(.*)$ - [L,NC] to my .htaccess file and it seems to have fixed the issue for the primary domain.

However, I needed an ssl certificate for the staging website as well (which is in the same cPanel account). Generating a certificate for staging.website.com wasn't working. I noticed that www.staging.website.com wasn't resolving and since my NameServer is on GoDaddy, I needed to add a cname record for the www. After that, the plugin had no problems generating the certificate for staging.website.com.

WilliamIsted commented 8 years ago

@MouseEatsCat Glad you got to the bottom of it, I think most of these http-01 issues are likely to be DNS related.

uhlhosting commented 8 years ago

@WilliamIsted all my domains face this issues.

WilliamIsted commented 8 years ago

@highacid could you provide one of the domains having the issue? Are the cPanel accounts using single domains or using Aliases and/or Addon Domains at all? And have you tried the .htaccess rule within your Document Root?

uhlhosting commented 8 years ago

@WilliamIsted Just single domains no aliases, no addons. I did not changed the .htaccess rules at all, are the default from wordpress. IE: http://highacid.com . Ofc now it runs a manual SSL from another provider. Also http://unacunatura.com/

uhlhosting commented 8 years ago

Funny i reinstalled the plugin and it worked for unacunatura.com Successfully installed SSL certificate

WilliamIsted commented 8 years ago

Strange, glad at least it is working for you now though

uhlhosting commented 8 years ago

I believe he made some updates because it all looks different He should at least update these threads with info to update the plugin.

slrslr commented 8 years ago

im having this issue with .tk Addon domain which path is /home/user/public_html/addondomain.tk

i tried to add mentioned two lines:

RewriteEngine On
RewriteRule ^.well-known(.*)$ - [L,NC]

into .htaccess in public_html and addon domain directory, but that hae not fixed it. I tested that the domain is accessible from same server by doing: curl addondomain.tk

I wanted to upgrade this module by executing: "cd letsencrypt-cpanel" but that dir. does not exist.

itseasy21 commented 7 years ago

I'm also facing this issue, plugin works fine for main domain but i try to add ssl to addon domain while the main domain having ssl enabled it shows same error of http-01

talkquazi commented 7 years ago

I was facing this problem on some of my domains by not others. The solution for me was to add the above mentioned "well-known" rewrite rule to the very top of my .htaccess file in the public_html of the offending site and selecting the www. input as the alt-domains selection. I noticed domains using https or www forced htaccess rules cause this error.

I should also note that if your domain is using a service based cloudflare/github ssl or has a custom ssl already installed (via the cpanel not whm) then this error occurs. Also if you have a mishap in your apache configuration and your domain is pointing to another domain this error also occurs.

CENTOS 6.8 x86_64 xenhvm – enterprise WHM 62.0 (build 15)

twinedev commented 7 years ago

Just a note for others coming here looking up that error. cPanel now makes their own official plugin for Let's Encrypt, so that it is an option for the AutoSSL feature. See here:

https://blog.cpanel.com/announcing-cpanel-whms-official-lets-encrypt-with-autossl-plugin/

When enabled, it will automatically get an SSL for any new domain, addon domain, subdomain, and will automatically insert the rewrite rule into .htaccess where it needs to (ie, I put in a rule to force all traffice to be https:// and noticed next time I went to edit it, there was a line to tell it to ignore forcing .well-known to be secure.

slrslr commented 7 years ago

RE: twinedev yes, i ended up uninstalling this module:

/usr/local/cpanel/3rdparty/bin/git clone https://github.com/Prajithp/letsencrypt-cpanel.git cd letsencrypt-cpanel ./uninstall.sh

and then using mentioned official cPanel built in AutoSSL Let's Encrypt function.

https://blog.cpanel.com/announcing-cpanel-whms-official-lets-encrypt-with-autossl-plugin/

hendranata commented 7 years ago

yes i also face this problem.. cloudlinux 7.3 do know how to fix that