4096-bit SSH key for self-hosted GitLab instance

We would like to connect our Netlify site to a selfhosted Gitlab instance. So we run netlify init --manual. This prints a SSH key you need to allow on Gitlab.
However the key is not strong enough. Our Gitlab instance only allows us to add a key which is at least 4096 bit long.
How is it possible to get a longer key?

2 Likes

We have the same problem on our side.

We would be really glad if this problem could be solved cause we love both Netlify and Gitlab and it would be great if they could work well together!

Hey, @yag and @ada_1. Sorry to hear you’re both running into this :frowning: To be honest, I’m not positive what the problem is, but wanted to share a possibly related post below in case it’s helpful:

I’m also linking to an issue in the netlify-cli repo which may be related:

Based on that issue, do you want to give netlify sites:create --manual --with-ci a shot and let me know if that fixes things for you?

@jen thank you for your response!

So we tried the proposed fix by using the command netlify sites:create --manual --with-ci but we still run into the problem.

Indeed after giving our “SSH remote URL to enable CI with” in the cli process, we receive back a Netlify SSH public key as an RSA-2048 key which we should “Give this Netlify SSH public key access to your repository.”

Nevertheless, our self-hosted gitlab instance only allows us to provide deploy keys of at least 4096 bits so we cannot add this key.

So as asked in the beginning, is there any way we could retrieve a stronger Netlify SSH public key to match our self-hosted gitlab instance security standard?

Thanks for giving that a shot and reporting back. I’ve gone ahead and filed a feature request for 4096-bit keys. I’m also going to update the title of this post to hopefully make it easier for others running into this issue to let us know here. We’ll follow up here if/when this feature becomes a reality.

For anyone else reading this, please feel free to heart/like the comment. If you do, we’ll increment the “vote count” for the feature request (and this will increase the likelihood of the feature being added).

2 Likes

Exciting news: I believe this feature has been merged and will ship later today! You shouldn’t have to download anything new to implement it, since it was a change to our API that’s called when you run netlify init --manual. Please let us know if you run into any issues when you re-init.

3 Likes

Wow, awesome, I tested it right now, and we now can use Netlify build with our Gitlab instance.

1 Like