mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #21660 from overleaf/jpa-s3-https
[object-persistor] s3: simplify using a custom CA for HTTPS endpoints GitOrigin-RevId: 2c6a5312a842582e5e40e917ccc586392087cb7a
This commit is contained in:
@@ -523,7 +523,7 @@ class S3Persistor extends AbstractPersistor {
|
||||
if (this.settings.endpoint) {
|
||||
const endpoint = new URL(this.settings.endpoint)
|
||||
options.endpoint = this.settings.endpoint
|
||||
options.sslEnabled = endpoint.protocol === 'https'
|
||||
options.sslEnabled = endpoint.protocol === 'https:'
|
||||
}
|
||||
|
||||
// path-style access is only used for acceptance tests
|
||||
@@ -537,6 +537,14 @@ class S3Persistor extends AbstractPersistor {
|
||||
}
|
||||
}
|
||||
|
||||
if (options.sslEnabled && this.settings.ca && !options.httpOptions?.agent) {
|
||||
options.httpOptions = options.httpOptions || {}
|
||||
options.httpOptions.agent = new https.Agent({
|
||||
rejectUnauthorized: true,
|
||||
ca: this.settings.ca,
|
||||
})
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user