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

Make ssl-open timeout effective in golang client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.11.0
    • Go - Library
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: