HTTPS with SSL Certificate in DART HTTP Server

后端 未结 1 1521
野的像风
野的像风 2021-01-02 09:30

Does the Dart HTTP Server support HTTPS? If so, how do you specify the certificate? If not, are there any alternatives such as community created packages?

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 10:00

    Yes. Dart supports https.

    See the documentation here and a test here.

    Relevant lines:

    HttpServer.bindSecure(HOST_NAME,
                          0,
                          backlog: 5,
                          certificateName: 'localhost_cert').then((server) {
    

    0 讨论(0)
提交回复
热议问题