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

store CA in separate directory

This commit is contained in:
kroko / Reinis Adovičs
2018-02-07 23:16:51 +02:00
committed by GitHub
parent a2d446b871
commit 3f11288920

View File

@@ -183,6 +183,8 @@ function secure($url)
{ {
$this->unsecure($url); $this->unsecure($url);
$this->files->ensureDirExists($this->caPath(), user());
$this->files->ensureDirExists($this->certificatesPath(), user()); $this->files->ensureDirExists($this->certificatesPath(), user());
$this->createCa(); $this->createCa();
@@ -203,9 +205,9 @@ function secure($url)
*/ */
function createCa() function createCa()
{ {
$caPemPath = $this->certificatesPath().'/LaravelValetCASelfSigned.pem'; $caPemPath = $this->caPath().'/LaravelValetCASelfSigned.pem';
$caKeyPath = $this->certificatesPath().'/LaravelValetCASelfSigned.key'; $caKeyPath = $this->caPath().'/LaravelValetCASelfSigned.key';
$caAffixPath = $this->certificatesPath().'/LaravelValetCASelfSigned.affix'; $caAffixPath = $this->caPath().'/LaravelValetCASelfSigned.affix';
if ($this->files->exists($caKeyPath) && $this->files->exists($caPemPath) && $this->files->exists($caAffixPath)) { if ($this->files->exists($caKeyPath) && $this->files->exists($caPemPath) && $this->files->exists($caAffixPath)) {
return; return;
@@ -254,9 +256,9 @@ function createCa()
*/ */
function createCertificate($url) function createCertificate($url)
{ {
$caPemPath = $this->certificatesPath().'/LaravelValetCASelfSigned.pem'; $caPemPath = $this->caPath().'/LaravelValetCASelfSigned.pem';
$caKeyPath = $this->certificatesPath().'/LaravelValetCASelfSigned.key'; $caKeyPath = $this->caPath().'/LaravelValetCASelfSigned.key';
$caSrlPath = $this->certificatesPath().'/LaravelValetCASelfSigned.srl'; $caSrlPath = $this->caPath().'/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';
@@ -390,6 +392,16 @@ function sitesPath()
return VALET_HOME_PATH.'/Sites'; return VALET_HOME_PATH.'/Sites';
} }
/**
* Get the path to the Valet CA certificates.
*
* @return string
*/
function caPath()
{
return VALET_HOME_PATH.'/CA';
}
/** /**
* Get the path to the Valet TLS certificates. * Get the path to the Valet TLS certificates.
* *