go - Golang - TLS handshake error -


i running https web server in go. testing using angular web app (chrome browser) makes ajax calls web server.

if keep hitting web server continuously seems working. whenever leave idle sometime , hit web server ajax call browser doesn't response. see log line in server log.

2016/01/16 04:06:47.006977 http: tls handshake error 42.21.139.47:51463: eof

i can confirm ip address ip address.

i starting https server this:

r := mux.newrouter() r.handlefunc("/status", handlestatus) setuploginendpoint(&cfg.session, r) setuplogoutendpoint(cfg.session.cookiename, r) setupchangepasswordendpoint(cfg.session.cookiename, r) setupmetricsinkendpoint(cfg.metric.sinkapikey, r) setupmetricqueryendpoint(cfg.session.cookiename, r) http.listenandservetls(":443", "../cert.pem", "../keys.pem", &server{r}) 

i can confirm closing request body in every handler using defer r.body.close().

i using go 1.5.2.

any appreciated.

regards,

sathya

i enabled tcp keepalive , problem got solved. running vm in google compute engine , firewall terminated idle connections.

tcp keep alive

configuring tcp keep alive in linux

golang http server automatically picked up, no change required in golang code.

regards,

sathya


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -