Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4307

Make ssl-open timeout effective in golang client

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.10.0
    • Fix Version/s: 0.11.0
    • Component/s: Go - Library
    • Labels:
      None

      Description

      package rpc
      
      import (
      	"git.apache.org/thrift.git/lib/go/thrift"
      
      	"crypto/tls"
      	"time"
      )
      
      func open() {
      	var (
      		addr             = "192.168.1.100:4000"
      		timeout          = time.Second * 10
      		transportFactory = thrift.NewTTransportFactory()
      		transport        thrift.TTransport
      		err              error
      	)
      
      	// timeout work in normal socket
      	if transport, err = thrift.NewTSocketTimeout(addr, timeout); err != nil {
      		return
      	}
      
      	// timeout not work in SSL Socket
      	if transport, err = thrift.NewTSSLSocketTimeout(addr, &tls.Config{
      		InsecureSkipVerify: true,
      	}, timeout); err != nil {
      		return
      	}
      
      	transport = transportFactory.GetTransport(transport)
      }
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jking3 James E. King III
                Reporter:
                tudyzhb tudyzhb
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: