
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
ssl-validator
Advanced tools
This module is a validator for SSL Certificates using the PEM node module. You can validate SSL Keys, SSL Certificates, SSL Certificate Domains, SSL Certificate Bundles, etc.
npm install ssl-validator
or
yarn add ssl-validator
All of these functions will throw an error if something is invalid, except the isValid functions
, which will return true
or false
.
const { validateSSL } = require('ssl-validator');
await validateSSL(cert, options);
Option | Type | Default | Description |
---|---|---|---|
skipDateValidation | Boolean | false | Skip verifying the certificate's and/or bundle's validity period. |
key | String | When given, validates that the key and certificate are a pair. | |
domain | String | When given, verifies the certificate is valid for this domain. e.g. 'github.com' | |
bundle | String | When given, verifies the certificate bundle and certificate go together. | |
skipFormatValidation | Boolean | false | When true skip validation the format of the certificate and the key. |
password | String | A password that will be given to openssl when verfiying the key. |
This function validates that the certificate is an SSL certificate and checks the validity period.
const { validateSSLCert } = require('ssl-validator');
await validateSSLCert(cert, options);
Option | Type | Default | Description |
---|---|---|---|
skipDateValidation | Boolean | false | Skip verifying the given certificate's validity period. |
skipFormatValidation | Boolean | false | When true, skip validation the format of the certificate. |
This function validates that the certificate is an SSL certificate and checks the validity period.
const { validateSSLKey } = require('ssl-validator');
await validateSSLKey(key, options);
Option | Type | Default | Description |
---|---|---|---|
password | String | A password that will be given to openssl when verfiying the key. | |
skipFormatValidation | Boolean | false | When true, skip validation the format of the key. |
This function validates that the certificate and the bundle are certificates, and ensures that the bundle and certificate go together.
const { validateCertBundle } = require('ssl-validator');
await validateCertBundle(cert, bundle, options);
Option | Type | Default | Description |
---|---|---|---|
skipDateValidation | Boolean | false | Skip verifying the certificate's and/or bundle's validity period. |
key | String | When given, validates that the key and certificate are a pair. | |
domain | String | When given, verifies the certificate is valid for this domain. e.g. 'github.com' | |
skipFormatValidation | Boolean | false | When true skip validation the format of the certificate and the key. |
password | String | A password that will be given to openssl when verfiying the key. |
This function validates that the given certificate and key are a matching pair.
const { validateCertKeyPair } = require('ssl-validator');
await validateCertKeyPair(cert, key, options);
Option | Type | Default | Description |
---|---|---|---|
skipDateValidation | Boolean | false | Skip verifying the certificate's and/or bundle's validity period. |
domain | String | When given, verifies the certificate is valid for this domain. e.g. 'github.com' | |
bundle | String | When given, verifies the certificate bundle and certificate go together. | |
skipFormatValidation | Boolean | false | When true skip validation the format of the certificate and the key. |
password | String | A password that will be given to openssl when verfiying the key. |
This function validates the given certificate and that it matches the given domain.
const { validateCertToDomain } = require('ssl-validator');
await validateCertToDomain(cert, domain, options);
Option | Type | Default | Description |
---|---|---|---|
skipDateValidation | Boolean | false | Skip verifying the certificate's and/or bundle's validity period. |
key | String | When given, validates that the key and certificate are a pair. | |
bundle | String | When given, verifies the certificate bundle and certificate go together. | |
skipFormatValidation | Boolean | false | When true skip validation the format of the certificate and the key. |
password | String | A password that will be given to openssl when verfiying the key. |
Each of the functions listed above (validateSSL, validateSSLCert, etc.) has a counterpart that will not throw any errors but will return true
when valid and false
when not valid. All arguments and options are listed above are valid.
Original Function Name | Predicate Function Name |
---|---|
validateSSL | isValidSSL |
validateSSLCert | isValidSSLCert |
validateSSLKey | isValidSSLKey |
validateCertBundle | isValidCertBundle |
validateCertKeyPair | isValidCertKeyPair |
validateCertToDomain | isValidCertToDomain |
const { isValidSSL } = require('ssl-validator');
if (!(await isValidSSL(cert))) {
return { message: 'Sorry, the certificate supplied is not valid.' };
}
The module is available as open source under the terms of the MIT License.
4.1.0 - 2024-08-29
FAQs
Validator for certificates, bundles, and keys
The npm package ssl-validator receives a total of 4,743 weekly downloads. As such, ssl-validator popularity was classified as popular.
We found that ssl-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.