getssl icon indicating copy to clipboard operation
getssl copied to clipboard

gets: Error registering account

Open jklymak opened this issue 10 years ago • 27 comments

I'm trying to get a certificate for s simple website, but obviously missed something along the way. I run getssl -d valdez.seos.uvic.ca

and get a lot of messages (some of which I assume is private) and the script dies at:

HTTP/1.1 400 Bad Request
Seve: nginx
Content-Type: application/poblem+json
Content-Length: 96
Boulde-Request-Id: K38nGSwtV9FEDvdut4U_X0cLo2DxtcFt8y-miG0e7PM
Replay-Nonce: GzAWOzPm4nhwRBALTSGIZv966XcgikiVcqzOvB6xb0
Expies: Thu, 16 Jun 2016 18:30:34 GMT
Cache-Contol: max-age=0, no-cache, no-stoe
Pagma: no-cache
Date: Thu, 16 Jun 2016 18:30:34 GMT
Connection: close

response {
  "type": "urn:acme:error:malformed",
  "detail": "Parse error reading JWS",
  "status": 400
}
code 400
getssl: Error registering account

I could send the whole request, but maybe it is obvious that I've not done something correctly.

jklymak avatar Jun 16 '16 18:06 jklymak

Hi, sorry was out earlier.

Yes, some of the debug information ( about the private key etc ) should be kept private.

I may need the bit just before this though.

I assume you have correctly put your email address into the config file. There were also some changes on the letsencrypt acme server at the same time as your error message (which could be related).

Can you check running again please, and if still an error (if all OK, it was the changes happening at LE), then paste me the config file (or in pastebin.com ) and the bit of the debug log immediately prior to the error above.

Thanks

ghost avatar Jun 16 '16 21:06 ghost

Same error:

Config file:

# Uncomment and modify any variables you need
# The staging server is best for testing (hence set as default)
#CA="https://acme-staging.api.letsencrypt.org"
# This server issues full certificates, however has rate limits
CA="https://acme-v01.api.letsencrypt.org"

AGREEMENT="https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf"

# Set an email address associated with your account - generally set at account level rather than domain.
ACCOUNT_EMAIL="[email protected]"
ACCOUNT_KEY_LENGTH=4096
ACCOUNT_KEY="/Users/jklymak/.getssl/account.key"
PRIVATE_KEY_ALG="rsa"

# The command needed to reload apache / nginx or whatever you use
#RELOAD_CMD=""
# The time period within which you want to allow renewal of a certificate
#  this prevents hitting some of the rate limits.
RENEW_ALLOW="30"

# Define the server type.  This can either be a webserver, ldaps or a port number which
# will be checked for certificate expiry and also will be checked after
# an update to confirm correct certificate is running (if CHECK_REMOTE) is set to true
SERVER_TYPE="webserver"
CHECK_REMOTE="true"

# openssl config file.  The default should work in most cases.
SSLCONF="/Users/jklymak/anaconda/ssl/openssl.cnf"

# Use the following 3 variables if you want to validate via DNS
#VALIDATE_VIA_DNS="true"
#DNS_ADD_COMMAND=
#DNS_DEL_COMMAND=
#AUTH_DNS_SERVER=""
#DNS_WAIT=10
#DNS_EXTRA_WAIT=60

The error with hopefully everything cut, but not too much...

downloads/getssl -d valdez.seos.uvic.ca
checking for required openssl ... /Users/jklymak/anaconda/bin/openssl
checking for required curl ... /usr/bin/curl
checking for required nslookup ... /usr/bin/nslookup
checking for required sed ... /usr/bin/sed
checking for required grep ... /usr/bin/grep
checking for required awk ... /usr/bin/awk
checking for required tr ... /usr/bin/tr
current code is version 1.05
Most recent version is  1.05
reading config from /Users/jklymak/.getssl/getssl.cfg
Making temp directory - /Users/jklymak/.getssl/valdez.seos.uvic.ca/tmp
reading config from /Users/jklymak/.getssl/valdez.seos.uvic.ca/getssl.cfg
getting certificate for valdez.seos.uvic.ca from remote server
no certificate obtained from host
Account key exists at /Users/jklymak/.getssl/account.key skipping generation
domain key exists at /Users/jklymak/.getssl/valdez.seos.uvic.ca/valdez.seos.uvic.ca.key - skipping generation
created SAN list = subjectAltName=DNS:valdez.seos.uvic.ca,DNS:www.valdez.seos.uvic.ca
checking nslookup for valdez.seos.uvic.ca
checking nslookup for www.valdez.seos.uvic.ca
domain csr exists at - /Users/jklymak/.getssl/valdez.seos.uvic.ca/valdez.seos.uvic.ca.csr
Registering account
url https://acme-v01.api.letsencrypt.org/acme/new-reg
payload {"resource": "new-reg", "contact": ["mailto: [email protected]"], "agreement": "https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf"}
payload64 CUT
nonce CUT
protected {"alg": "RS256", "jwk": {"e": "AQAB", "kty": "RSA", "n": "CUT"}CUT"}, "nonce": "CUT
data for account registration = {"header": {"alg": "RS256", "jwk": {"e": "AQAB", "kty": "RSA", "n": "CUT_BIG_LONG_STRING"}
responseHeaders HTTP/1.1 100 Continue
Expies: Thu, 16 Jun 2016 21:51:44 GMT
Cache-Contol: max-age=0, no-cache, no-stoe
Pagma: no-cache

HTTP/1.1 400 Bad Request
Seve: nginx
Content-Type: application/poblem+json
Content-Length: 96
Boulde-Request-Id: vswu_iW6t79e2HkOTJXOCAqF3Y84RX8VgLDe3Ag00
Replay-Nonce: jHKu3-x-ikbGf0ZlM_ocIJgkCqdoxM_-oAvHGyDw0c
Expies: Thu, 16 Jun 2016 21:51:44 GMT
Cache-Contol: max-age=0, no-cache, no-stoe
Pagma: no-cache
Date: Thu, 16 Jun 2016 21:51:44 GMT
Connection: close

response {
  "type": "urn:acme:error:malformed",
  "detail": "Parse error reading JWS",
  "status": 400
}
code 400
getssl: Error registering account

jklymak avatar Jun 16 '16 21:06 jklymak

One of the quotes in the string after "nonce" is not closed in the error message. Not sure if that effects things, or is just a character dropped from the error message

jklymak avatar Jun 16 '16 22:06 jklymak

I'm just running some tests to see if I can duplicate it. Can you test on the staging server ( change in the first few lines of the config file) and see if you get the same error there.

ghost avatar Jun 16 '16 22:06 ghost

Yes, exactly the same...

jklymak avatar Jun 16 '16 22:06 jklymak

OK, interesting. I haven't come across a bad nonce with these symptoms before, and can't duplicate it at the moment.

If it's happening on both the staging and full server then it's not because of anything LE related, but something in the message transmission / reply. The missing quote doesn't appear to be significant ...

ghost avatar Jun 16 '16 22:06 ghost

I probably should have specified I'm on OS X.

jklymak avatar Jun 16 '16 22:06 jklymak

What OS are you on ? ( just to see if I use any code that may be different ... ahh, OK - OS X ... checking

ghost avatar Jun 16 '16 22:06 ghost

I don't use OS X myself - and haven't got it to be able to test .... will have a look at the functions in this part of the code though, and see if there is a difference on OS X to standard bash

ghost avatar Jun 16 '16 22:06 ghost

I'm guessing it's probably the sed command ..... at lines 333 - 339 the code checks to see if the bash is linux-gnu or not (and was assuming older BSD compatibility if not) .... what's the "$OSTYPE" on OSX ? and if you just change both those options to be "sed -r" does it change what you get ?

ghost avatar Jun 16 '16 22:06 ghost

what's the "$OSTYPE" on OSX ?

darwin15

sed -r gives an illegal option for my sed.

I installed gsed and set those lines to gsed -r, but it returns exactly the same error

jklymak avatar Jun 16 '16 22:06 jklymak

OK - I assume that your sed is OK with "sed -E" for extended then, which it should use in that case .... so that's not the issue.

ghost avatar Jun 16 '16 22:06 ghost

The other components used I wouldn't have expected to be different ( openssl, tr, grep ) I wouldn't have expected to be different on OSX to linux. I'll see if I can get hold of a machine with OSX over the weekend to test with if you like

ghost avatar Jun 16 '16 22:06 ghost

  1. its not super important. I serve up ipython notebooks, and its tiresome not having a signed certificate.

  2. If you wanted to write me at [email protected], I could set you up on one of my OS X machines that you could access via ssh. Might not be until tonight (I have to go do a few things)

jklymak avatar Jun 16 '16 22:06 jklymak

no rush - that would be great - will email you, thanks.

ghost avatar Jun 16 '16 22:06 ghost

I don't know if this means anything, but from your post it looks like the response is dropping all the lower case "r" characters. Something not parsing correctly?

rdswift avatar Jun 16 '16 22:06 rdswift

The big strings have lower-case "r"-s in them.

jklymak avatar Jun 16 '16 22:06 jklymak

I was looking at the section quoted below:

responseHeaders HTTP/1.1 100 Continue
Expies: Thu, 16 Jun 2016 21:51:44 GMT
Cache-Contol: max-age=0, no-cache, no-stoe
Pagma: no-cache

HTTP/1.1 400 Bad Request
Seve: nginx
Content-Type: application/poblem+json
Content-Length: 96
Boulde-Request-Id: vswu_iW6t79e2HkOTJXOCAqF3Y84RX8VgLDe3Ag00
Replay-Nonce: jHKu3-x-ikbGf0ZlM_ocIJgkCqdoxM_-oAvHGyDw0c
Expies: Thu, 16 Jun 2016 21:51:44 GMT
Cache-Contol: max-age=0, no-cache, no-stoe
Pagma: no-cache
Date: Thu, 16 Jun 2016 21:51:44 GMT
Connection: close

The lower case "r" characters seem to be missing from everything after the first line. It may be completely irrelevant, but I thought I would point it out in case it does lead somewhere and you may have missed it.

rdswift avatar Jun 16 '16 23:06 rdswift

Right - interesting. Doesn't seem to be a problem before responseHeaders

jklymak avatar Jun 16 '16 23:06 jklymak

Good spot. My immediate thought was that a deletion of carriage return / line feeds ( "tr -d '\n\r' " ) is somehow behaving oddly, but that shouldn't affect those lines ....

ghost avatar Jun 17 '16 05:06 ghost