mrgswift/laravel-encryptenv

Got problem when running on HTTPS

hijrahsaputra opened this issue · 7 comments

Configkey not running on HTTPS

@hijrahsaputra I have this running on multiple websites using https. This is most likely an issue with your nginx/apache configuration. Can you post your virtual host configuration (without your configkey or other confidential information)?
For example: you can X out your configkey.

@mrgswift thanks for your attention, this is my virtualhost config :
<IfModule mod_ssl.c> <VirtualHost *:443> ServerName example.go.id ServerAlias example.go.id DocumentRoot /var/www/example/public RewriteEngine on RewriteCond %{SERVER_NAME} =example.go.id RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] <If "%{SCRIPT_FILENAME} == '/var/www/example/public/index.php'"> SetEnv CONFIGKEY "XXX" </If> ErrorLog /var/www/example/error.log CustomLog /var/www/example/requests.log combined SSLCertificateFile /etc/letsencrypt/live/example.go.id/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.go.id/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateChainFile /etc/letsencrypt/live/example.go.id/chain.pem </VirtualHost> </IfModule>

@hijrahsaputra Do you have a closing if block </If> in your config file at the end of your if statement? Also are you getting any errors when you start apache?

@mrgswift comment not completely display my confiiguration...already edited, thanks you

@hijrahsaputra Did you solve your problem? Just asking so I can close this issue if you did.

@mrgswift not yet..HTTPS cannot read configkey, and decrypt variable ENC:

One possibility:

It seems apache in some versions has problems with the returning the full path in the environment variable SCRIPT_FILENAME.
More here: https://www.javaer101.com/en/article/16643525.html

I and others have gotten this working without any problems on multiple websites using https. Without actually seeing your config file, I can only speculate to what is going on. Since this is an apache configuration issue, this does go beyond the scope of support. For this reason, I am closing this issue. I am open to suggestions on how to better improve the example for apache in the Readme. If you do figure it out, please feel free to start a pull request to update the Readme file.