Adding support to SSLv3 to TLS

This commit is contained in:
vilherda 2023-04-24 15:12:43 +02:00
parent fa73d6accd
commit bf043338b6
3 changed files with 14 additions and 2 deletions

View File

@ -54,6 +54,8 @@ Some features:
in_reply_to: <random-luke@example.com>
# Optional unsigned/invalid certificates allowance:
ignore_cert: true
# Optional Sets the secure SSL version v3
ciphers_sslv3: true
# Optional converting Markdown to HTML (set content_type to text/html too):
convert_markdown: true
# Optional attachments:

View File

@ -48,6 +48,9 @@ inputs:
ignore_cert:
description: Allow unsigned/invalid certificates
required: false
ciphers_sslv3:
description: Sets the secure SSL version v3
required: true
convert_markdown:
description: Convert body from Markdown to HTML (set content_type input as text/html too)
required: false

11
main.js
View File

@ -90,6 +90,7 @@ async function main() {
const attachments = core.getInput("attachments", { required: false })
const convertMarkdown = core.getInput("convert_markdown", { required: false })
const ignoreCert = core.getInput("ignore_cert", { required: false })
const ciphersSSLv3 = core.getInput("ciphers_sslv3", { required: false })
const priority = core.getInput("priority", { required: false })
if (!serverAddress) {
@ -100,7 +101,7 @@ async function main() {
core.warning("Username and password not specified. You should only do this if you are using a self-hosted runner to access an on-premise mail server.")
}
const transport = nodemailer.createTransport({
const transportOptions = {
host: serverAddress,
auth: username && password ? {
user: username,
@ -111,7 +112,13 @@ async function main() {
tls: ignoreCert == "true" ? {
rejectUnauthorized: false
} : undefined,
})
}
if (ignoreCert == "true" && ciphersSSLv3 == "true") {
transportOptions.tls.ciphers = 'SSLv3'
}
const transport = nodemailer.createTransport(transportOptions)
const info = await transport.sendMail({
from: getFrom(from, username),