thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "tudyzhb (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (THRIFT-4307) Make ssl-open timeout effective in golang client
Date Mon, 04 Sep 2017 02:33:00 GMT

     [ https://issues.apache.org/jira/browse/THRIFT-4307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

tudyzhb updated THRIFT-4307:
----------------------------
    Description: 
{code:none}
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)
}

{code}


  was:

{code:golang}
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)
}

{code}



> Make ssl-open timeout effective in golang client
> ------------------------------------------------
>
>                 Key: THRIFT-4307
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4307
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Library
>    Affects Versions: 0.10.0, 0.11.0
>            Reporter: tudyzhb
>             Fix For: 0.10.0, 0.11.0
>
>
> {code:none}
> 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)
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message