# Can Ray Serve handle https? \[2023\]

**URL:** <https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598>\
**Category:** Ray Serve\
**Created:** [October 26, 2023, 7:01am UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598 "2023-10-26T07:01:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![salman-moh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/salman-moh/32/3969_2.png) [@salman-moh](https://discuss.ray.io/u/salman-moh)\
**Post date:** [October 26, 2023, 7:01am UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/1 "2023-10-26T07:01:31Z")

</div>

Critical for taking app into production:

- High: It blocks me to complete my task.

There was an old post already for this, has anything changed or anyone know some smart workaround sticking to Ray only and not using a Reverse Proxy?

> [@Can ray serve handle https requests?](https://discuss.ray.io/t/can-ray-serve-handle-https-requests/1143):
>
> all is in the title slight_smile I could not find any information about it in the docs so I am asking it here. I would like to use ray serve in production but I will need ray to handle and answer requests in HTTPS, will it be possible ? Thank you for your answer slight_smile

---

<div class="post-metadata">

**Author:** ![Gene](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gene/32/4701_2.png) [@Gene](https://discuss.ray.io/u/Gene)\
**Post date:** [October 26, 2023, 4:15pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/2 "2023-10-26T16:15:11Z")

</div>

Hi @salman-moh

Yes, Ray Serve by default will start an HTTP proxy on every node (given it has at least one replica or is on head node) API doc: [ray.serve.start — Ray 2.7.1](https://docs.ray.io/en/latest/serve/api/doc/ray.serve.start.html)

You can read more on how to use it [Set Up FastAPI and HTTP — Ray 2.7.1](https://docs.ray.io/en/latest/serve/http-guide.html)

Also as a side node, if you have a need for sending gRPC requests for slightly better performance over HTTP, there is also a guide on using Serve’s gRPC server [Set Up a gRPC Service — Ray 2.7.1](https://docs.ray.io/en/latest/serve/advanced-guides/grpc-guide.html#serve-set-up-grpc-service)

---

<div class="post-metadata">

**Author:** ![salman-moh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/salman-moh/32/3969_2.png) [@salman-moh](https://discuss.ray.io/u/salman-moh)\
**Post date:** [October 26, 2023, 4:47pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/3 "2023-10-26T16:47:41Z")

</div>

I’m talking about HTTPS, not HTTP.

---

<div class="post-metadata">

**Author:** ![Gene](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gene/32/4701_2.png) [@Gene](https://discuss.ray.io/u/Gene)\
**Post date:** [October 26, 2023, 4:54pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/4 "2023-10-26T16:54:54Z")

</div>

Oh sorry, I misread it. The state of HTTPS has not changed since. Feel free to drop a PR for updating that logic. I think you would mostly be changing [this file](https://github.com/ray-project/ray/blob/master/python/ray/serve/_private/proxy.py#L1269) and some API to pass the certs

---

<div class="post-metadata">

**Author:** ![Jules\_Damji](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jules_damji/32/4058_2.png) [@Jules\_Damji](https://discuss.ray.io/u/Jules_Damji)\
**Post date:** [October 27, 2023, 4:45pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/5 "2023-10-27T16:45:21Z")

</div>

@Gene Can you use TLS configuration for all HTTP comms? [TLS Authentication — Ray 2.7.1](https://docs.ray.io/en/latest/cluster/kubernetes/user-guides/tls.html). This is more for K8s or use if for secure gRPC?

---

<div class="post-metadata">

**Author:** ![Gene](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gene/32/4701_2.png) [@Gene](https://discuss.ray.io/u/Gene)\
**Post date:** [October 27, 2023, 4:50pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/6 "2023-10-27T16:50:54Z")

</div>

Thanks for the doc Jules! I think the doc is about using TLS between Ray clusters. The question is more about how the HTTP proxy works in Ray Serve. In the current state, Ray Serve uses still uses uvicorn server under the hood and requires some code changes to get that TLS setup for HTTPS 🙂

---

<div class="post-metadata">

**Author:** ![Jules\_Damji](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jules_damji/32/4058_2.png) [@Jules\_Damji](https://discuss.ray.io/u/Jules_Damji)\
**Post date:** [October 27, 2023, 4:53pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/7 "2023-10-27T16:53:18Z")

</div>

Yes, indeed @gene. Wonder if we should file a issue if there is more demand for it. Surprised that it has not come up.

---

<div class="post-metadata">

**Author:** ![Gene](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gene/32/4701_2.png) [@Gene](https://discuss.ray.io/u/Gene)\
**Post date:** [October 27, 2023, 5:03pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/8 "2023-10-27T17:03:22Z")

</div>

Did some search and found there is an issue related to this already [[Serve] Allow HTTPs Options in Ray Serve · Issue #26814 · ray-project/ray · GitHub](https://github.com/ray-project/ray/issues/26814) I think we can prioritized accordingly

---

<div class="post-metadata">

**Author:** ![Jules\_Damji](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jules_damji/32/4058_2.png) [@Jules\_Damji](https://discuss.ray.io/u/Jules_Damji)\
**Post date:** [October 27, 2023, 5:09pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/9 "2023-10-27T17:09:09Z")

</div>

@salman-moh There’s issue filed already, and we as team will triage it to prioritize it. Can we mark this as resolved?

---

<div class="post-metadata">

**Author:** ![chusol](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@chusol](https://discuss.ray.io/u/chusol)\
**Post date:** [September 4, 2024, 6:09pm UTC](https://discuss.ray.io/t/can-ray-serve-handle-https-2023/12598/10 "2024-09-04T18:09:10Z")

</div>

How is a critical component of a server, configuring a web server to handle HTTPS requests, missing? When this is missing, the sever is essentially a toy server.
