1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-06 08:40:09 +01:00

explicit CA serial for macOS 10.13.3

This commit is contained in:
kroko / Reinis Adovičs
2018-02-07 22:03:36 +02:00
committed by GitHub
parent 192456d369
commit 9b543f4aa0

View File

@@ -256,6 +256,7 @@ function createCertificate($url)
{ {
$caPemPath = $this->certificatesPath().'/LaravelValetCASelfSigned.pem'; $caPemPath = $this->certificatesPath().'/LaravelValetCASelfSigned.pem';
$caKeyPath = $this->certificatesPath().'/LaravelValetCASelfSigned.key'; $caKeyPath = $this->certificatesPath().'/LaravelValetCASelfSigned.key';
$caSrlPath = $this->certificatesPath().'/LaravelValetCASelfSigned.srl';
$keyPath = $this->certificatesPath().'/'.$url.'.key'; $keyPath = $this->certificatesPath().'/'.$url.'.key';
$csrPath = $this->certificatesPath().'/'.$url.'.csr'; $csrPath = $this->certificatesPath().'/'.$url.'.csr';
$crtPath = $this->certificatesPath().'/'.$url.'.crt'; $crtPath = $this->certificatesPath().'/'.$url.'.crt';
@@ -265,9 +266,14 @@ function createCertificate($url)
$this->createPrivateKey($keyPath); $this->createPrivateKey($keyPath);
$this->createSigningRequest($url, $keyPath, $csrPath, $confPath); $this->createSigningRequest($url, $keyPath, $csrPath, $confPath);
$caSrlParam = '-CAcreateserial ';
if ($this->files->exists($caSrlPath)) {
$caSrlParam = '-CAserial ' . $caSrlPath;
}
$this->cli->runAsUser(sprintf( $this->cli->runAsUser(sprintf(
'openssl x509 -req -sha256 -days 730 -CA %s -CAkey %s -in %s -out %s -extensions v3_req -extfile %s', 'openssl x509 -req -sha256 -days 730 -CA %s -CAkey %s %s -in %s -out %s -extensions v3_req -extfile %s',
$caPemPath, $caKeyPath, $csrPath, $crtPath, $confPath $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
)); ));
$this->trustCertificate($crtPath); $this->trustCertificate($crtPath);