mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 11:23:11 -06:00
Add insecure test Mode(#609)
Signed-off-by: Nan ZiYuan <quarkstar9@gmail.com>
This commit is contained in:
parent
9e63152573
commit
1d4e22d819
|
|
@ -107,7 +107,7 @@ func NewAppServiceQueryAPIHTTP(
|
|||
) AppServiceQueryAPI {
|
||||
if httpClient == nil {
|
||||
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
if Cfg.Test.SkipSSLVerify == true {
|
||||
if Cfg.Test.SkipSSLVerify {
|
||||
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
}
|
||||
httpClient = &http.Client{
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func SetupAppServiceAPIComponent(
|
|||
},
|
||||
Cfg: base.Cfg,
|
||||
}
|
||||
if base.Cfg.Test.SkipSSLVerify == true {
|
||||
if base.Cfg.Test.SkipSSLVerify {
|
||||
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
appserviceQueryAPI.HTTPClient = &http.Client{
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ func (a *AppServiceQueryAPI) UserIDExists(
|
|||
// makeHTTPClient creates an HTTP client with certain options that will be used for all query requests to application services
|
||||
func makeHTTPClient(skipSSLVerify bool) *http.Client {
|
||||
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
if skipSSLVerify == true {
|
||||
if skipSSLVerify {
|
||||
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
}
|
||||
return &http.Client{
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ func queryIDServerStoreInvite(
|
|||
}
|
||||
|
||||
client := http.Client{}
|
||||
if cfg.Test.SkipSSLVerify == true {
|
||||
if cfg.Test.SkipSSLVerify {
|
||||
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
client = http.Client{
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ func CreateSession(
|
|||
request.Header.Add("Content-Type", "application/x-www-form-urlencoded")
|
||||
|
||||
client := http.Client{}
|
||||
if cfg.Test.SkipSSLVerify == true {
|
||||
if cfg.Test.SkipSSLVerify {
|
||||
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
client = http.Client{
|
||||
|
|
@ -171,7 +171,7 @@ func PublishAssociation(creds Credentials, userID string, cfg *config.Dendrite)
|
|||
request.Header.Add("Content-Type", "application/x-www-form-urlencoded")
|
||||
|
||||
client := http.Client{}
|
||||
if cfg.Test.SkipSSLVerify == true {
|
||||
if cfg.Test.SkipSSLVerify {
|
||||
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||
client = http.Client{
|
||||
|
|
|
|||
Loading…
Reference in a new issue