Skip to content

error in libcrypto, loading ssh key from an environment variable #21481

Closed Answered by churumellas
ctaque asked this question in Q&A
Discussion options

You must be logged in to vote

Hey guys, for future readers. I was using a ssh key file inside Gitlab CI YAML file and I kept getting error in libcrypto message. I did 2 things that FIXED the problem:

1. Just changing the variable type from `FILE` variable to `ENV_VAR`

2. Using `ssh-keygen -t ed25519` when generating the key. Looks like gitlab does not support the default `rsa` keys.

Then everything works fine.

Also use this as the base before_script:

  before_script:
    - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client wget gnupg -y )'
    - wget -qO- https://get.docker.com/gpg | apt-key add -
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add …

Replies: 11 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@yypastushenko
Comment options

@govindkailas
Comment options

@SirawichDev
Comment options

Answer selected by paulidale
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
triaged: question The issue contains a question resolved: answered The issue contained a question which has been answered
Converted from issue

This discussion was converted from issue #19487 on July 18, 2023 05:28.