Skip to content

Commit

Permalink
Change to BEGIN(\sNEW)? CERTIFICATE REQUEST
Browse files Browse the repository at this point in the history
BEGIN(\sNEW)? CERTIFICATE REQUEST is better for some OLD CSR.
  • Loading branch information
Dexus committed Mar 26, 2014
1 parent 4cd57cd commit 8eed789
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/pem.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function getPublicKey(certificate, callback){

var params;

if(certificate.match(/BEGIN CERTIFICATE REQUEST/)){
if(certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)){
params = ["req",
"-in",
"--TMPFILE--",
Expand Down Expand Up @@ -302,7 +302,7 @@ function readCertificateInfo(certificate, callback){

certificate = (certificate || "").toString();

var type = certificate.match(/BEGIN CERTIFICATE REQUEST/)?"req":"x509",
var type = certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)?"req":"x509",
params = [type,
"-noout",
"-text",
Expand All @@ -325,7 +325,7 @@ function readCertificateInfo(certificate, callback){
*/
function getModulus(certificate, callback){
var type = "";
if ( certificate.match(/BEGIN CERTIFICATE REQUEST/)){
if ( certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)){
type="req";
}else if ( certificate.match(/BEGIN RSA PRIVATE KEY/)){
type="rsa";
Expand Down

0 comments on commit 8eed789

Please sign in to comment.