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

STARTTLS is not working #66

Open
mathe42 opened this issue Feb 12, 2023 · 0 comments
Open

STARTTLS is not working #66

mathe42 opened this issue Feb 12, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mathe42
Copy link
Member

mathe42 commented Feb 12, 2023

Describe the bug

STARTTLS is not working

To Reproduce / minimal example

function sleep(to: number) {
    return new Promise((res)=>setTimeout(res, to))
}

const conn1 = await Deno.connect({
    hostname: "sandbox.smtp.mailtrap.io",
    port: 25
})

const enc = new TextEncoder()
await conn1.write(enc.encode("EHLO sandbox.smtp.mailtrap.io"))

// Wait until connection is ready for starttls
await sleep(2000)
await conn1.write(enc.encode("STARTTLS"))

const reader = conn1.readable.getReader()
// const reader = {read(){}}

// ??? What to put here

await Deno.startTls(conn1, {
    hostname: "sandbox.smtp.mailtrap.io"
})

// Make sure no GC is happening!
await reader.read()

The code needed at ??? is needed in client/base/connection.ts in line 40

Additional context

Reopens #65 and #59

@mathe42 mathe42 added the bug Something isn't working label Feb 12, 2023
@mathe42 mathe42 self-assigned this Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant