Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Custom HTTPS files results in error:0909006C:PEM routines:get_name:no start line #1798

Closed
wants to merge 4 commits into from

Conversation

ryc76
Copy link
Contributor

@ryc76 ryc76 commented Jul 1, 2021

Specifying HTTPS key pair in Vite config fails causes dev server to fail

example config

server: {
		ssr: true,
		https: {
			key: '/privkey.pem',
			cert: '/fullchain.pem'
		}
	},

Run npx svelte-kit dev --https

Results in

error:0909006C:PEM routines:get_name:no start line

Vite was being passed the path of the files rather the file themselves.

Odd as I'm sure this used to work.

@changeset-bot
Copy link

changeset-bot bot commented Jul 1, 2021

⚠️ No Changeset found

Latest commit: 0135b58

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -1,5 +1,6 @@
import http from 'http';
import https from 'https';
import fs from 'fs';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'd probably be nice to add a blank line after this one for style consistency

@benmccann
Copy link
Member

This would need a changeset

It'd be nice to know if this was always broken or broke recently. Maybe a Vite upgrade broke it? I wonder if it works with an older version of Vite

@Rich-Harris
Copy link
Member

I'm not sure I follow — Vite isn't involved in this process, the code changed in this PR is SvelteKit's own helper for starting an http/https server. Did this work in a previous version? I'd be inclined to keep the current behaviour — it's easy to do fs.readFileSync inside your config file, but if it's expecting a filename then you can't pass a value directly

@ryc76
Copy link
Contributor Author

ryc76 commented Jul 2, 2021

This would need a changeset

It'd be nice to know if this was always broken or broke recently. Maybe a Vite upgrade broke it? I wonder if it works with an older version of Vite

I believe this commit broke it

5aa64ab
#844

@benmccann benmccann changed the title Custom HTTPS files results in error:0909006C:PEM routines:get_name:no start line [fix] Custom HTTPS files results in error:0909006C:PEM routines:get_name:no start line Jul 3, 2021
@benmccann
Copy link
Member

I believe this commit broke it

@ryc76 can you explain what the breakage was? I'm not seeing that the referenced PR did anything with either of those options

@ryc76
Copy link
Contributor Author

ryc76 commented Jul 27, 2021

I've revisited and can't get this working with older commits as I thought I could. I'm happy to go with @Rich-Harris suggestion of using fs.readFileSync inside the svelte.config.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants