Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for mutual TLS #149

Merged
merged 4 commits into from
Nov 20, 2023
Merged

Conversation

JonErickson
Copy link
Contributor

@JonErickson JonErickson commented Nov 17, 2023

The need for this PR arose out of our use of this package in a SaaS we are developing where we will pushing data via web hooks that is extremely sensitive in nature. We need to use all available options to ensure the integrity of our data and so we are requiring mutual TLS authentication. This PR adds support for mutual TLS that is already natively supported in Guzzle.

A custom CA cert can be optionally passed to the verifySsl method. The method now accepts booleans or strings to support cert paths.

Implementation:

WebhookCall::create()
  ->mutualTls(
    certPath: storage_path('path/to/cert.pem'), 
    certPassphrase: 'optional_cert_passphrase', 
    sslKeyPath: storage_path('path/to/key.pem'), 
    sslKeyPassphrase: 'optional_key_passphrase'
  )
  ->verifySsl(storage_path('path/to/ca.pem'))
  ->dispatch();

@JonErickson JonErickson marked this pull request as draft November 17, 2023 19:35
@JonErickson JonErickson marked this pull request as ready for review November 17, 2023 19:53
@freekmurze freekmurze merged commit cdb00c2 into spatie:main Nov 20, 2023
8 checks passed
@freekmurze
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants