@DPJack this is not the issue. Digging into the source code, I found laravel's EncryptionServiceProvider is the one that makes the check for the Cipher length. I think the issue seem to be that the .env file is not readable during that check and that throws the a RuntimeException.
public function register()
{
$this->app->singleton('encrypter', function ($app) {
$config = $app->make('config')->get('app');
$key = $config['key']; // this piece of code is just trying to read the config file and I think it does not process the 'key' => env('APP_KEY')
$cipher = $config['cipher']; // same here
if (Encrypter::supported($key, $cipher)) {
return new Encrypter($key, $cipher);
} elseif (McryptEncrypter::supported($key, $cipher)) {
return new McryptEncrypter($key, $cipher);
} else {
throw new RuntimeException('No supported encrypter found. The cipher and / or key length are invalid.');
}
});
}
// Encrypter supported method
public static function supported($key, $cipher)
{
$length = mb_strlen($key, '8bit');
return ($cipher === 'AES-128-CBC' && $length === 16) || ($cipher === 'AES-256-CBC' && $length === 32);
}
// McryptEncrypter supported method
public static function supported($key, $cipher)
{
return defined('MCRYPT_RIJNDAEL_128') &&
($cipher === MCRYPT_RIJNDAEL_128 || $cipher === MCRYPT_RIJNDAEL_256);
}
In the config.php file I have 'key' => env('APP_KEY'), which is how I am getting to assume that the .env file becomes not readable for some reason. This also seem to happen not only in Homestead, but also in any Homestead like environment which is not good!
If Laravel supports the usage of .environment files, could it try { }catch(e){ } this check and maybe try env('APP_KEY') if $config['key'] fails?