Explorar el Código

Fix: default to port 443

Rod Hynes hace 11 meses
padre
commit
062e88ca92
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      psiphon/server/inproxy.go

+ 7 - 1
psiphon/server/inproxy.go

@@ -148,6 +148,12 @@ func NewInproxyProxyQualityBrokerRoundTripper(
 	// fingerprints, and TCP and TLS fragmentation, TLS padding, and other
 	// fingerprints, and TCP and TLS fragmentation, TLS padding, and other
 	// mechanisms.
 	// mechanisms.
 
 
+	// FrontingSpec.Addresses may include a port; default to 443 if none.
+	dialAddress := frontingDialAddress
+	if _, _, err := net.SplitHostPort(dialAddress); err != nil {
+		dialAddress = net.JoinHostPort(frontingDialAddress, "443")
+	}
+
 	var tlsConfigRootCAs *x509.CertPool
 	var tlsConfigRootCAs *x509.CertPool
 	if trustedCACertificates != "" {
 	if trustedCACertificates != "" {
 		tlsConfigRootCAs = x509.NewCertPool()
 		tlsConfigRootCAs = x509.NewCertPool()
@@ -160,7 +166,7 @@ func NewInproxyProxyQualityBrokerRoundTripper(
 
 
 	transport := &http.Transport{
 	transport := &http.Transport{
 		DialTLSContext: func(ctx context.Context, network, _ string) (net.Conn, error) {
 		DialTLSContext: func(ctx context.Context, network, _ string) (net.Conn, error) {
-			conn, err := (&net.Dialer{}).DialContext(ctx, network, frontingDialAddress)
+			conn, err := (&net.Dialer{}).DialContext(ctx, network, dialAddress)
 			if err != nil {
 			if err != nil {
 				return nil, errors.Trace(err)
 				return nil, errors.Trace(err)
 			}
 			}