@@ -353,7 +353,7 @@ public function test_add_proxy()
353353 $ site ->assertCertificateNotExists ('my-new-proxy.com.test ' );
354354 $ site ->assertNginxNotExists ('my-new-proxy.com.test ' );
355355
356- $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' );
356+ $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' , true );
357357
358358 $ site ->assertCertificateExistsWithCounterValue ('my-new-proxy.com.test ' , 0 );
359359 $ site ->assertNginxExists ('my-new-proxy.com.test ' );
@@ -368,6 +368,41 @@ public function test_add_proxy()
368368 ], $ site ->proxies ()->all ());
369369 }
370370
371+
372+ public function test_add_non_secure_proxy ()
373+ {
374+ $ config = Mockery::mock (Configuration::class);
375+ $ config ->shouldReceive ('read ' )
376+ ->andReturn (['tld ' => 'test ' , 'loopback ' => VALET_LOOPBACK ]);
377+
378+ swap (Configuration::class, $ config );
379+
380+ swap (CommandLine::class, resolve (CommandLineFake::class));
381+
382+ /** @var FixturesSiteFake $site */
383+ $ site = resolve (FixturesSiteFake::class);
384+
385+ $ site ->useOutput ();
386+
387+ $ site ->assertCertificateNotExists ('my-new-proxy.com.test ' );
388+ $ site ->assertNginxNotExists ('my-new-proxy.com.test ' );
389+
390+ $ site ->proxyCreate ('my-new-proxy.com ' , 'http://127.0.0.1:9443 ' , false );
391+
392+ $ site ->assertCertificateNotExists ('my-new-proxy.com.test ' );
393+ $ site ->assertNginxExists ('my-new-proxy.com.test ' );
394+
395+ $ this ->assertEquals ([
396+ 'my-new-proxy.com ' => [
397+ 'site ' => 'my-new-proxy.com ' ,
398+ 'secured ' => '' ,
399+ 'url ' => 'http://my-new-proxy.com.test ' ,
400+ 'path ' => 'http://127.0.0.1:9443 ' ,
401+ ],
402+ ], $ site ->proxies ()->all ());
403+ }
404+
405+
371406 public function test_add_proxy_clears_previous_proxy_certificate ()
372407 {
373408 $ config = Mockery::mock (Configuration::class);
@@ -383,7 +418,7 @@ public function test_add_proxy_clears_previous_proxy_certificate()
383418
384419 $ site ->useOutput ();
385420
386- $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:7443 ' );
421+ $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:7443 ' , true );
387422
388423 $ site ->assertCertificateExistsWithCounterValue ('my-new-proxy.com.test ' , 0 );
389424
@@ -397,7 +432,7 @@ public function test_add_proxy_clears_previous_proxy_certificate()
397432 ], $ site ->proxies ()->all ());
398433
399434 // Note: different proxy port
400- $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' );
435+ $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' , true );
401436
402437 // This shows we created a new certificate.
403438 $ site ->assertCertificateExistsWithCounterValue ('my-new-proxy.com.test ' , 1 );
@@ -435,7 +470,7 @@ public function test_add_proxy_clears_previous_non_proxy_certificate()
435470 $ site ->assertCertificateExistsWithCounterValue ('my-new-proxy.com.test ' , 0 );
436471 $ site ->assertNginxNotExists ('my-new-proxy.com.test ' );
437472
438- $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' );
473+ $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' , true );
439474
440475 // This shows we created a new certificate.
441476 $ site ->assertCertificateExistsWithCounterValue ('my-new-proxy.com.test ' , 1 );
@@ -472,7 +507,7 @@ public function test_remove_proxy()
472507
473508 $ this ->assertEquals ([], $ site ->proxies ()->all ());
474509
475- $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' );
510+ $ site ->proxyCreate ('my-new-proxy.com ' , 'https://127.0.0.1:9443 ' , true );
476511
477512 $ this ->assertEquals ([
478513 'my-new-proxy.com ' => [
0 commit comments