小编alb*_*ert的帖子

golang TLS是否支持IE8?

最新的Chrome/IE9/Firefox都运行良好.IE8抱怨页面无法显示,看起来连接中止.这里是快速测试代码.

package main

import (
    "time"
    "fmt"
    "net/http"
)

type Handler struct {
}

func (this *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    fmt.Fprintf(w, "Hello, %q", r.URL.Path)
}

func main() {
    handler := &Handler{}
    ss := &http.Server{
        Addr: ":443",
        Handler: handler,
        ReadTimeout: 10 * time.Second,
        WriteTimeout: 10 * time.Second,
        MaxHeaderBytes: 1 << 20,
    }
    ss.ListenAndServeTLS("cert.pem", "key.pem")
}
Run Code Online (Sandbox Code Playgroud)

注意,"cert.pem"和"key.pem"由"crypto/tls/generate_cert.go"生成.我尝试了一个真正的证书,它也没有用.

go

5
推荐指数
1
解决办法
879
查看次数

标签 统计

go ×1