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.
Download spatie/ssl-certificate
More information about spatie/ssl-certificate
Files in spatie/ssl-certificate
Package ssl-certificate
Short Description A class to easily query the properties of an ssl certificate
License MIT
Homepage https://github.com/spatie/ssl-certificate
Informations about the package ssl-certificate
A class to validate SSL certificates
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
- Freek Van der Herten
- All Contributors
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
ext-intl Version *
ext-json Version *
nesbot/carbon Version ^2.68.1|^3.0
spatie/macroable Version ^2.0