Skip to content
Snippets Groups Projects
Commit 4b75e58b authored by deuce's avatar deuce
Browse files

Fix account creation.

parent 70e3e167
No related branches found
No related tags found
No related merge requests found
...@@ -48,9 +48,13 @@ function ACMEv2(opts) ...@@ -48,9 +48,13 @@ function ACMEv2(opts)
this.host = opts.host; this.host = opts.host;
this.jws_format = 'sha256'; this.jws_format = 'sha256';
this.ua = new HTTPRequest(); this.ua = new HTTPRequest();
if (this.key_id === undefined) if (this.key_id === undefined) {
try {
this.get_key_id(); this.get_key_id();
} }
catch(e) {}
}
}
ACMEv2.prototype.get_key_id = function() ACMEv2.prototype.get_key_id = function()
{ {
...@@ -161,7 +165,7 @@ ACMEv2.prototype.post = function(link, data) ...@@ -161,7 +165,7 @@ ACMEv2.prototype.post = function(link, data)
url = this.get_directory(link)[link]; url = this.get_directory(link)[link];
if (url === undefined) if (url === undefined)
throw('Unknown link name: "'+link+'"'); throw('Unknown link name: "'+link+'"');
return this.post_url(url, data); return this.post_url(url, data, post_method);
} }
ACMEv2.prototype.get_nonce = function() ACMEv2.prototype.get_nonce = function()
...@@ -258,6 +262,8 @@ ACMEv2.prototype.post_url = function(url, data, post_method) ...@@ -258,6 +262,8 @@ ACMEv2.prototype.post_url = function(url, data, post_method)
if (post_method === undefined) if (post_method === undefined)
post_method = 'post_key_id'; post_method = 'post_key_id';
print("URL: "+url);
print("Method: "+post_method);
switch(post_method) { switch(post_method) {
case 'post_key_id': case 'post_key_id':
protected.nonce = this.get_nonce(); protected.nonce = this.get_nonce();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment