我正在尝试将InsecureSkipVerify: true
参数与appengine
一起使用,但是在执行dev_appserver.py app.yaml
代码时出现以下错误:
错误2019-02-02 16:44:49,039 http_runtime.py:420]错误的运行时进程端口['']
紧急:接口转换:http.RoundTripper是init.failingTransport,而不是* http.Transport
appengine.Main()
中已内置的端口
然后如何将InsecureSkipVerify
与appengine
一起使用?
app.yaml
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
main.go
package main
import (
"encoding/json"
"github.com/gorilla/mux"
"net/http"
"google.golang.org/appengine"
"crypto/tls"
)
type Foo struct {
Text string `json:"text"`
}
func GetInfo(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(Foo{"hello"})
}
func init(){
r := mux.NewRouter()
r.HandleFunc("/sample", GetInfo)
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
http.Handle("/", r)
}
func main() {
appengine.Main()
}