jedu
jedu

Reputation: 1331

Nodejs DNS verify using HTTP file upload

I am trying to verify my DNS to get an SSL certificate using the file upload verification method:

enter image description here

enter image description here

I am using Nodejs express and did this:

router.get("/.well-known/pki-validation/6BFB7F1676F92A093F1BF1E6E425082F.txt",async function(req,res){
    res.sendFile('./6BFB7F1676F92A093F1BF1E6E425082F.txt',{root: __dirname})
})

When i go the the url I can see the contents of the file. But when I click verify I get:

enter image description here

What am I doing wrong?

Upvotes: 1

Views: 867

Answers (1)

VnDevil
VnDevil

Reputation: 1391

with expressjs try this code in index.js file to verify with "HTTP file upload" method:

...
app.get('/.well-known/pki-validation/2CBXXXXX_HTTP_FILE_UPLOAD_VERIFY_METHOD.txt', function (req, res, next) {
    res.send('2CBXXXXX_HTTP_FILE_UPLOAD_VERIFY_METHOD content');
});
...

Upvotes: 2

Related Questions