Download the PHP package spatie/ssl-certificate without Composer

On this page you can find all versions of the php package spatie/ssl-certificate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ssl-certificate

A class to validate SSL certificates

Latest Version on Packagist run-tests Quality Score Total Downloads

The class provided by this package makes it incredibly easy to query the properties on an ssl certificate. We have three options for fetching a certficate. Here's an example:

Downloading invalid certificate

If you want to download certificates even if they are invalid (for example, if they are expired), you can pass a $verifyCertificate boolean to SslCertificate::createFromHostname() as the third argument, for example:

About us

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can install the package via composer:

Important notice

Currently, this package does not check if the certificate is signed by a trusted authority. We'll add this check soon in a next point release.

Usage

You can create an instance of Spatie\SslCertificate\SslCertificate with this named constructor:

You can create an instance of Spatie\SslCertificate\SslCertificate passing the port with this named constructor:

You can use this fluent style to specify a specific port to connect to.

You can check the certificate on a different IP address using the same style.

This also works with IPv6 addresses

You can specify socket context options.

If the given ipAddress is invalid Spatie\SslCertificate\Exceptions\InvalidIpAddress will be thrown.

If the given hostName is invalid Spatie\SslCertificate\Exceptions\InvalidUrl will be thrown.

If the given hostName is valid but there was a problem downloading the certifcate Spatie\SslCertificate\Exceptions\CouldNotDownloadCertificate will be thrown.

Getting the issuer name

Getting the domain name

Returns the primary domain name for the certificate

Getting the certificate's signing algorithm

Returns the algorithm used for signing the certificate

Getting the certificate's organization

Returns the organization belonging to the certificate

Getting the additional domain names

A certificate can cover multiple (sub)domains. Here's how to get them.

A domain name return with this method can start with * meaning it is valid for all subdomains of that domain.

Getting the fingerprint

Getting the SHA256 fingerprint

Getting the date when the certificate becomes valid

Getting the expiration date

Determining if the certificate is still valid

Returns true if the current Date and time is between validFromDate and expirationDate.

You also use this method to determine if a given domain is covered by the certificate. Of course it'll keep checking if the current Date and time is between validFromDate and expirationDate.

Determining if the certificate is still valid until a given date

Returns true if the certificate is valid and if the expirationDate is after the given date.

Determining if the certificate is expired

Convert the certificate to an array

You can convert a certificate to an array using the toArray method.

The properties can be used to create a new instance of the certificate.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

The helper functions and tests were copied from the Laravel Framework.

License

The MIT License (MIT). Please see License File for more information.


All versions of ssl-certificate with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-intl Version *
ext-json Version *
nesbot/carbon Version ^2.68.1|^3.0
spatie/macroable Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package spatie/ssl-certificate contains the following files

Loading the files please wait ....