Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCSP check failed against windows blob storage #27

Open
howryu opened this issue Jul 4, 2018 · 0 comments
Open

OCSP check failed against windows blob storage #27

howryu opened this issue Jul 4, 2018 · 0 comments

Comments

@howryu
Copy link

howryu commented Jul 4, 2018

I am using ocsp 1.2.0 and latest of asn1.js-rfc5280. However, ocsp check failed with error Invalid signauture when checking against azure blob storage(while it succeed for amazons s3). So I am wondering what is wrong, and also, is there anyway to turn on logging to further troubleshooting the issue.

I wrote a simple javascript to reproduce the issue. Note, check failed on windows.net, but succeed for s3 endpoint.

const tls = require('tls');
const ocsp = require('ocsp');
const rfc5280 = require('asn1.js-rfc5280');

const options = {
  host: "2srsfctest1stage000.blob.core.windows.net",
  //host: "s3-eu-west-1.amazonaws.com",
  port: 443
};

const socket = tls.connect(8000, options, function(){
  cert = socket.getPeerCertificate(true);
  var issuer = cert.issuerCertificate;
  cert = cert.raw;
  try {
    cert = rfc5280.Certificate.decode(cert, 'der');

    if (issuer) {
      issuer = issuer.raw;
      issuer = rfc5280.Certificate.decode(issuer, 'der');
    }
  } catch (e) {
    console.log(e);
  }

  ocsp.check({
    cert: cert,
    issuer: issuer
  }, function(err, res){
    if (err)
    {
      console.log(err);
    }

    if (res)
    {
      console.log(res);
    }
  })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant