Socket
Book a DemoInstallSign in
Socket

mkchain

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkchain

2.0.2
bundlerRubygems
Version published
Maintainers
2
Created
Source

mkchain

Given a certificate filename as input, mkchain will attempt to build the intermediate certificate chain, and print it to stdout. This replaces the need to copy/edit cert-vendor provided chain files and deal with certificate order.

Installation

$ rake install

Command-line Usage

$ mkchain site.example.com.crt > site.example.com.chain
$ mkchain -c 2025-05-30 site.example.com.crt > site.example.com.chain
$ mkchain -lr site.example.com.crt > site.example.com.fullchain

Ruby Library

You can also invoke mkchain from Ruby code:

require 'mkchain'
chain_str = MkChain.new(include_root: true).chain(File.read(cert_filename))

This method returns a string containing the contents of the intermediate chain in PEM format. If no chain can be built from the certificate, a MkChain::NoChainFoundException will be raised. If no chain is necessary (ie, if the certificate was signed directly by the root CA), then an empty string will be returned.

No guarantee

This method of building an intermediate chain depends on the signing certificate being in the authorityInfoAccess X.509 extension field under CA Issuers. That's a common but not universal pattern.

Similar Tools

  • https://whatsmychaincert.com/
  • https://github.com/SSLMate/mkcertchain

FAQs

Package last updated on 31 Jul 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.