benbjohnson / litestream

Streaming replication for SQLite.
https://litestream.io
Apache License 2.0
11.1k stars 256 forks source link

Support disabling HTTPS for non-localhost S3-compatible stores #506

Closed bengesoff closed 1 year ago

bengesoff commented 1 year ago

The getting started guide uses Minio as an S3-compatible store, but runs it in Docker with a port-forward to a local port. In the S3 replication client code there is an explicit exception for localhost to use HTTP instead of HTTPS, to avoid the overhead of having to set up TLS certificates inside the Docker container for Minio to use. However, for any other endpoint, HTTPS cannot be disabled.

I'm following a similar "getting started"-esque workflow but with a simple Minio Kubernetes pod, and I would also like to use plain HTTP, but I can't find a way of disabling HTTPS. I'm getting the following logs

cannot fetch generations: RequestError: send request failed
caused by: Get "https://my-k8s-vsc.dev.svc.cluster.local:9000/bucket?delimiter=%2F&prefix=db.sqlite%2Fgenerations%2F": http: server gave HTTP response to HTTPS client

I would like to add a config file option called disable-tls, similar to the existing skip-verify option, but to completely disable HTTPS. Would this be acceptable or would it count as a new feature?

hifi commented 1 year ago

Use the endpoint key to configure it as http://my-k8s-vsc.dev.svc.cluster.local:9000 and it will work over plain HTTP.

bengesoff commented 1 year ago

@hifi genius, thank you