Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 在Google应用程序引擎中处理HTTPS请求_Google App Engine_Ssl_Go_Https_Ssl Certificate - Fatal编程技术网

Google app engine 在Google应用程序引擎中处理HTTPS请求

Google app engine 在Google应用程序引擎中处理HTTPS请求,google-app-engine,ssl,go,https,ssl-certificate,Google App Engine,Ssl,Go,Https,Ssl Certificate,在GAE中,我只使用默认域名:https://*.appspot.com,因此我不需要生成自签名证书 Google App Engine文档指定应如何配置App.yaml以服务SSL连接: 但为了在Go中提供HTTPS连接,我编写了以下代码示例,其中需要指定证书的文件名: import ( "net/http" ) func main() { go http.ListenAndServeTLS(Address, "cert.pem", "key.pem", nil) } 如

在GAE中,我只使用默认域名:https://*.appspot.com,因此我不需要生成自签名证书

Google App Engine文档指定应如何配置App.yaml以服务SSL连接:

但为了在Go中提供HTTPS连接,我编写了以下代码示例,其中需要指定证书的文件名:

import (
    "net/http"
)

func main() {
    go http.ListenAndServeTLS(Address, "cert.pem", "key.pem", nil)
}

如果我自己不生成证书,我不知道在这种情况下如何为SSL请求提供服务。

您不需要在App Engine上调用http.listendServetls。如果您的
app.yaml
设置正确,流量将通过SSL为您提供服务。最小的应用程序引擎应用程序可能如下所示:

package main

import (
    "fmt"
    "net/http"
)

func init() {
    http.HandleFunc("/", handler)
}

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprint(w, "Hi")
}

你不需要在appengine上调用http.ListenAndServeTLS。如果您的
app.yaml
设置正确,流量将通过SSL为您提供服务。最小的应用程序引擎应用程序可能如下所示:

package main

import (
    "fmt"
    "net/http"
)

func init() {
    http.HandleFunc("/", handler)
}

func handler(w http.ResponseWriter, r *http.Request) {
    fmt.Fprint(w, "Hi")
}

非常感谢。我会尽快检查的谢谢!我很快会查的