squarecat/doc-buddy

tlsv1 unrecognized alert 112

Opened this issue · 5 comments

Trying to get this to run locally instead of on DO since I prefer to selfhost. However am running into this error:

$ node index.js
[server]: started on 1333
[server]: Bot listening...
Error: write EPROTO 139860701919168:error:14094458:SSL routines:ssl3_read_bytes:tlsv1 unrecognized name:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1565:SSL alert number 112

    at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16) {
  errno: -71,
  code: 'EPROTO',
  syscall: 'write',
  '$metadata': { attempts: 1, totalRetryDelay: 0 }
}
null

Any ideas? It looks like it's complaining about my S3 config, but as far as I'm able to tell, my s3 config is correct. I'm using minio to back it with a Let's encrypt cert.

STORAGE_NAME="docbuddy-bucket-name"
STORAGE_URL="https://s3.my.domain/"
STORAGE_KEY="my_access_key"
STORAGE_SECRET="my_secret_key"

What am I missing here? I have several other applications using this s3 endpoint, so I know it works, and I've confirmed the bucket manually via commandline too.

Based on the error it looks like its trying to use TLSv1? How can I configure it to use TLSv1.2?

I didn't add an nvm spec, but can you try using Node 16 because that's what I'm using.

I've aded an .nvmrc and engines prop to the package.json so you should get a warning now if you're not using v16

I am using node 16. Did a pull and have the nvmrc and am still seeing the same error.

$ node --version
v16.20.0

I will see if I can try to test on a real S3 bucket tomorrow. Any other debugging suggestions are welcome.

I guess it's something to do with your cert, but I'm not sure. The error specifically says the server name is not present. Maybe we can change the s3 request to ignore ssl errors?

I've never seen this error with any of my other services, so not sure what's different.

I'd be willing to give that a shot. Got a patch I can apply? It can at least help us narrow down where the problem is