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

Custom SSL cert creation fails if ~/.ssh directory doesn't exist #6

Open
jnebeker opened this issue Feb 7, 2019 · 0 comments
Open

Comments

@jnebeker
Copy link
Contributor

jnebeker commented Feb 7, 2019

Came across this when setting up @jkim628's local dev environment. She had not generated a ssh keypair yet so she had no ~/.ssh directory which caused the creation of the custom SSL cert to fail:

@combined_cert = Pathname("~/.ssh/pumadev.pem").expand_path

File.open(combined_cert, "w") do |cert_file|
cert_file.write base_cert.read
cert_file.write "\n"
cert_file.write cert.read
end

here was the error we were getting:

Configuring SSL...
Creating custom CA SSL cert for puma-dev...
Traceback (most recent call last):
    2: from bin/puma-dev-conf:100:in `<main>'
    1: from bin/puma-dev-conf:100:in `open'
bin/puma-dev-conf:100:in `initialize': No such file or directory @ rb_sysopen - /Users/julianakim/.ssh/pumadev.pem (Errno::ENOENT)

Once we ran ssh-keygen and the ~/.ssh directory was created everything was fine, but it would be nice to catch this edge case and spit out a helpful error message.

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

No branches or pull requests

1 participant