Files
coolify/tests/Unit/GenerateSshKeyTest.php
Andras BacsaiandClaude Opus 5.5 4bdf03db69 fix(keys): generate 4096-bit RSA keys
GitHub rejects new RSA SSH keys smaller than 3072 bits, and phpseclib
made 2048-bit keys by default, so new RSA deploy keys from Coolify
could not authenticate.

Closes #12461

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 11:26:31 +01:00

16 lines
523 B
PHP

<?php
use phpseclib3\Crypt\PublicKeyLoader;
use phpseclib3\Crypt\RSA;
it('generates RSA keys that GitHub accepts (at least 3072 bits)', function () {
$keyPair = generateSSHKey('rsa');
$privateKey = PublicKeyLoader::load($keyPair['private']);
$publicKey = PublicKeyLoader::load($keyPair['public']);
expect($privateKey)->toBeInstanceOf(RSA\PrivateKey::class)
->and($privateKey->getLength())->toBeGreaterThanOrEqual(3072)
->and($publicKey->getLength())->toBe($privateKey->getLength());
});