get-ssl-certificate
Advanced tools
Comparing version 2.2.1 to 2.3.0
10
index.js
@@ -28,3 +28,3 @@ var https = require('https'); | ||
function getOptions(url) { | ||
function getOptions(url, port, protocol) { | ||
return { | ||
@@ -34,3 +34,5 @@ hostname: url, | ||
rejectUnauthorized: false, | ||
ciphers: 'ALL' | ||
ciphers: 'ALL', | ||
port, | ||
protocol | ||
}; | ||
@@ -60,6 +62,6 @@ } | ||
function get(url, timeout) { | ||
function get(url, timeout, port = 443, protocol = 'https:') { | ||
validateUrl(url); | ||
var options = getOptions(url); | ||
var options = getOptions(url, port, protocol); | ||
@@ -66,0 +68,0 @@ return new Promise(function(resolve, reject) { |
{ | ||
"name": "get-ssl-certificate", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "A micro-library that returns a website's SSL certificate", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# get-ssl-certificate | ||
## A micro-library that returns a website's SSL certificate | ||
## A zero-dependency utility that returns a website's SSL certificate | ||
@@ -8,3 +8,3 @@ [![Build Status](https://travis-ci.org/johncrisostomo/get-ssl-certificate.svg?branch=master)](https://travis-ci.org/johncrisostomo/get-ssl-certificate) | ||
[![Code Climate](https://codeclimate.com/github/johncrisostomo/get-ssl-certificate/badges/gpa.svg)](https://codeclimate.com/github/johncrisostomo/get-ssl-certificate) | ||
[![npm](https://img.shields.io/badge/npm-v2.2.1-blue.svg)](https://www.npmjs.com/package/get-ssl-certificate) | ||
[![npm](https://img.shields.io/badge/npm-v2.3.0-blue.svg)](https://www.npmjs.com/package/get-ssl-certificate) | ||
@@ -53,6 +53,6 @@ ### Installation | ||
#### Optional: Pass timeout (in ms) | ||
#### Optional parameters: Timeout (in ms), Protocol (Default is 'https:') and Port (Default is 443) | ||
``` | ||
sslCertificate.get('nodejs.org', 250).then(function (certificate) { | ||
sslCertificate.get('nodejs.org', 250, 443, 'https:').then(function (certificate) { | ||
console.log(certificate) | ||
@@ -59,0 +59,0 @@ // certificate is a JavaScript object |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14991
194