mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-10-19 16:17:34 +00:00
Fix custom tls setting for tlsmirror roundtripper enrollment
This commit is contained in:
committed by
Xiaokang Wang (Shelikhoo)
parent
9dd745f0ae
commit
393acfa847
@@ -77,6 +77,9 @@ func (h *httpTripperClient) RoundTrip(ctx context.Context, req request.Request,
|
||||
return resp, err
|
||||
}
|
||||
defer httpResp.Body.Close()
|
||||
if httpResp.StatusCode != http.StatusOK {
|
||||
newError("non-200 response: ", httpResp.Status).AtInfo().WriteToLog()
|
||||
}
|
||||
if streamingWriter == nil {
|
||||
result, err := io.ReadAll(httpResp.Body)
|
||||
if err != nil {
|
||||
|
||||
+5
-1
@@ -90,7 +90,11 @@ func (c *Client) Dial(ctx context.Context) (net.Conn, error) {
|
||||
return nil, newError("failed to dial to destination").Base(err).AtError()
|
||||
}
|
||||
if c.config.SecurityConfig != nil {
|
||||
securityEngine, err := common.CreateObject(c.ctx, c.config.SecurityConfig)
|
||||
securityConfigSetting, err := serial.GetInstanceOf(c.config.SecurityConfig)
|
||||
if err != nil {
|
||||
return nil, newError("unable to get security config instance").Base(err)
|
||||
}
|
||||
securityEngine, err := common.CreateObject(c.ctx, securityConfigSetting)
|
||||
if err != nil {
|
||||
return nil, newError("unable to create security engine from security settings").Base(err)
|
||||
}
|
||||
|
||||
+5
-1
@@ -99,7 +99,11 @@ func (c *ServerInverseRole) Dial(ctx context.Context) (net.Conn, error) {
|
||||
return nil, newError("failed to dial to destination").Base(err).AtError()
|
||||
}
|
||||
if c.config.SecurityConfig != nil {
|
||||
securityEngine, err := common.CreateObject(ctx, c.config.SecurityConfig)
|
||||
securityConfigSetting, err := serial.GetInstanceOf(c.config.SecurityConfig)
|
||||
if err != nil {
|
||||
return nil, newError("unable to get security config instance").Base(err)
|
||||
}
|
||||
securityEngine, err := common.CreateObject(c.ctx, securityConfigSetting)
|
||||
if err != nil {
|
||||
return nil, newError("unable to create security engine from security settings").Base(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user