How do I have HTTPS with Rollup proxy


This Content is from Stack Overflow. Question asked by Doof Warrior

I start my Svelte frontend using rollup and I have self signed certificate to use HTTPS locally. Then I need a proxy for my /Api backend. So I import

import dev from 'rollup-plugin-dev';

Then I add

!production && dev({
    dirs: ['public'],
    spa: 'public/index.html',
    port: 8080,
    proxy: [
        { from: '/Api', to: 'https://localhost:7255/Api' },

And I remove (default in the svelte template)

!production && serve(),

The proxy seems to work, I can reach /Api path without HTTPS. Just there is no HTTPS working anymore: ERR_SSL_PROTOCOL_ERROR in Chrome. Should I specify SSL certificates in the proxy ?

Currently SSL certificates are referenced in package.json

"scripts": {
    "build": "rollup -c",
    "dev": "rollup -c -w",
    "start": "sirv public --no-clear --http2 --cert %AppData%/ASP.NET/https/svelte-app.pem --key %AppData%/ASP.NET/https/svelte-app.key"


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?