You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with Vapor on Linux on a API which connects to a URL and send it a XML, this URL needs certificate authentication (.pem, or p12) and passphrase.
Using curl on terminal works perfect, with this command:
Now I'm trying to figure it to how to implement using TLSConfiguration.forClient(), based on this comment: #27 (comment), and I'm not sure how to "inject" the certificate and its passphrase and later using it on one of my routes.
Any help appreciated
The text was updated successfully, but these errors were encountered:
garanda21
changed the title
Authenticate using certificate and like curl's --cert option
Authenticate using certificate and passphrase like curl's --cert option
Mar 4, 2023
You need to set the privateKey and certificateChain fields on the TLSConfiguration. These take a NIOSSLCertificate and NIOSSLPrivateKey which support being constructed in a number of ways. Note that NIOSSL does not support having the private key and cert in a single file at this time, so you'd need them in separate files.
I'm working with Vapor on Linux on a API which connects to a URL and send it a XML, this URL needs certificate authentication (.pem, or p12) and passphrase.
Using curl on terminal works perfect, with this command:
curl -X POST https://myurl.com/api -H "ContentType: application/xml" --cert file.pem:password -d "<xml>my awesome xml</xml>"
Ref: https://curl.se/docs/manpage.html#-E
Now I'm trying to figure it to how to implement using
TLSConfiguration.forClient()
, based on this comment: #27 (comment), and I'm not sure how to "inject" the certificate and its passphrase and later using it on one of my routes.Any help appreciated
The text was updated successfully, but these errors were encountered: