austineric / Send-MailKitMessage

A replacement for PowerShell's obsolete Send-MailMessage implementing the Microsoft-recommended MailKit library.
https://www.powershellgallery.com/packages/Send-MailKitMessage
MIT License
44 stars 5 forks source link

May you can create a dev branch? #45

Open xRushG opened 2 months ago

xRushG commented 2 months ago

I have added three more parameters to the code I needed. You can find it in my Git fork. Should I push the pull request to your master branch, or would you prefer I don't?

1) disable CheckCertificateRevocation. Occasional downtimes, network issues, or offline servers can make it impossible to check the revocation status of certificates. [switch] -DisableCertificateRevocation

2) Accept all certificates regardless of errors (not recommended in production, good for debug.) [switch] -ServerCertificateValidationCallback

3) To authenticate the client to the server using a certificate X509Certificate2[] -ClientCertificates

urskog84 commented 1 month ago

God request @xRushG. i have similar problems with SSL validation. :)

can't parse JSON.  Raw result:

An error occurred while attempting to establish an SSL or TLS connection.

The server's SSL certificate could not be validated for the following reasons:
• An intermediate certificate has the following errors:
  • The revocation function was unable to check revocation for the certificate.
  • The revocation function was unable to check revocation because the revocation server was offline.

@austineric. any plan for this?

xRushG commented 1 month ago

Hey @urskog84

You can test it with my fork. There's only one commit from me, so you can easily see my changes. Compile and test it using the additional parameter -DisableCertificateRevocation. If that doesn't work, also add this parameter: -ServerCertificateValidationCallback.

I would be interested in your test results.