# Server Sent Events - https does not work: net::ERR\_HTTP2\_PROTOCOL\_ERROR

**URL:** <https://forum.elixirforum.com/t/server-sent-events-https-does-not-work-net-err-http2-protocol-error/39238>\
**Category:** Questions\
**Tags:** phoenix, sse\
**Created:** [April 27, 2021, 7:04am UTC](https://forum.elixirforum.com/t/server-sent-events-https-does-not-work-net-err-http2-protocol-error/39238 "2021-04-27T07:04:50Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Exadra37](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/exadra37/32/9183_2.png) [@Exadra37](https://forum.elixirforum.com/u/Exadra37)\
**Post date:** [April 27, 2021, 2:55pm UTC](https://forum.elixirforum.com/t/server-sent-events-https-does-not-work-net-err-http2-protocol-error/39238/7 "2021-04-27T14:55:55Z")

</div>

> [@vfsoraki](#):
>
> For local certificates, I use [makecert](https://github.com/FiloSottile/mkcert) to generate valid certificates for local domains. I am on Linux, but this or similar tools should be available for other OSes.

Phoenix has a built-in tool for this:

```elixir
mix phx.gen.cert

```

Check instructions at `config/dev.exs`:

```elixir
# ## SSL Support
#
# In order to use HTTPS in development, a self-signed
# certificate can be generated by running the following
# Mix task:
#
# mix phx.gen.cert
#
# Note that this task requires Erlang/OTP 20 or later.
# Run `mix help phx.gen.cert` for more information.
#
# The `http:` config above can be replaced with:
#
# https: [
# port: 4001,
# cipher_suite: :strong,
# keyfile: "priv/cert/selfsigned_key.pem",
# certfile: "priv/cert/selfsigned.pem"
# ],
#
# If desired, both `http:` and `https:` keys can be
# configured to run both http and https servers on
# different ports.

```

---

_[View the full topic](https://forum.elixirforum.com/t/server-sent-events-https-does-not-work-net-err-http2-protocol-error/39238)._
