Azure Website SSL - php

I not sure why i'm getting this error after i migrated my wordpress to Azure Websites. Previously the site working perfectly without any issue. I tried to install SSL (from comodo) to Azure Websites, top up SSL from cloudflare but it still not working.
MailChimp API Response : SSL certificate problem: unable to get local issuer certificate
Some online user said need to define the php.ini, but we have no access over the file hence i'm adding the following line to wp-config.php
ini_set('curl.cainfo', "cacert.pem");
the file located at same directory as wp-config. but it's still not working. please advice.
(I'm using custom domain)

You can use a custom PHP runtime, and then you can change php.ini and any of the PHP_INI_SYSTEM configurations.
Check here for details on how to use a custom php runtime, but basically you will upload the php version as a part of your site, and set is as the handler for *.php in Portal.

Related

How to fix SSL problem with WordPress pages?

I am working with my new website. I got SSL certificates file from Digicert SSL provider . I installed SSL as instructed . But my WordPress pages still get Insecure page error while other html and non-WordPress PHP pages works Okay. I am not sure what did i do wrong.
my website is
https://www.devbhusal.com/ shows insecure page error.
https://www.devbhusal.com/readme.html works fine.
https://www.devbhusal.com/test.php works fine.
If SSL installed successfully with domain and still site is not secure then please check if internal link used only http:// if yes then convert to https:// and still you not able to find then you can use https://wordpress.org/plugins/really-simple-ssl/ plugin.
I tried with simpl SSL and everything that I can find on internet. At last I made wordpress backup file, created new server in EC2 ,install fresh WordPress ,restore wordpress data and install SSL. Now it is working. I still couldn't figure out what went wrong with old settings.

phpmyadmin Index page loading but not displaying any info

My phpmyadmin was accessible prior to installing ssl on my abyss web server using http://.
Since I have set up my ssl config when I try to access phpmyadmin on https:// the page loads but nothing is displayed.
I have installed ssl across my whole domain.
Do I need to edit the config.inc file to enable phpmyadmin on ssl and if so what changes need to be made?
Must have been a corrupt file somehow.
Solution was to remove all old phpmyadmin files and reinstall with latest version from the phpmyadmin website.
All okay now.

Why does my twilio web application work in XAMPP but not in AZURE

I've created an application in php that sends texts out to people using the twilio api. It works perfectly in XAMPP but the php code doesn't run in Azure. Everytime I call it I get an error message saying "Failed to load resource: the server responded with a status of 500 (Internal Server Error)".
Is there a way I can solve this problem without having to create my own virtual server?
Usually, when we get 500 response, it means we get some errors on server scripts. And we can set the display_errors=On in PHP runtime on our Azure Web Apps for easy troubleshooting. Refer to https://azure.microsoft.com/en-in/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-configurations for details.
And you may check whether your application on Azure Web Apps has successfully installed the twilio lib. You can leverage composer to configure the sdk in composer.json, then when you deploy your application to Azure via Git, Azure service will install the dependencies in composer.json file automatically during the deployment task.
You can leverage require 'vendor/autoload.php' to load all the dependencies.
At the first time during the test, I got the following error:
Fatal error: Uncaught exception Services_Twilio_TinyHttpException with message SSL certificate problem...
So it may be the issue on your side too, you can add the certificate in PHP on Azure Web Apps, please refer to https://blogs.msdn.microsoft.com/azureossds/2015/06/12/verify-peer-certificate-from-php-curl-for-azure-apps/ for detailed steps.
Otherwise, you can simply edit TinyHttp.php in twilio lib:
add CURLOPT_SSL_VERIFYPEER => FALSE, at $opts array.
Refer to Twilio PHP - SSL certificate: self signed certificate in certificate chain for the same issue.
They have many possibles:
Your Azure running PHP in ISS Server, then you need convert your .htaccess file to web.config, simple, just go to website in IIS and on import your .htaccess file, IIS will convert your .htaccess in web.config.
Permissions on folder you are running.
PHP versions, check your PHP version on xampp and compare to PHP version on Azure. Your code can be compatible in your PHP Xampp but not in PHP Azure.
Extensions PHP, it is possible that your xampp has extensions for PHP enable that your Azure not are enable, like file_info, etc...

Impossible SSL CAS-certificates with phpCAS and examples. It only works without SSL server verification

I am doing a CAS integration with a project that I am doing with my university. The final integration should be made with symfony2, however first I need to make the example code working.
I finally get working the example_simple.php example with phpCAS 1.3.2 , however the directive:
phpCAS::setNoCasServerValidation();
is the enabled one. I think I should use instead:
phpCAS::setCasServerCACert($cas_server_ca_cert_path);
However when I enable this second one (and disable the other) then the authorization does not work anymore. Here is the relevant output line error of the log:
could not open URL 'https://cas_server.fi/cas/serviceValidate?service=http%3A%2F%2Flocalhost%2Fphpcas2%2Fdocs%2Fexamples%2Fexample_simple.php&ticket=ST-115606-M1Omd1cHWzbLbmxa1nYV-cas' to validate (CURL error #60: SSL certificate problem: unable to get local issuer certificate) [Client.php:2763]
The cas server provided me two .crt files:
MYCASRootCA.crt
MYCASLinuxSUBCA.crt
And they are suppose to be installed in my system (Ubuntu 13.10). They are in different places, such a /etc/ssl/certs/MYCASLinuxSUBCA.pem but also:
/usr/share/ca-certificates/lut/MYCASRootCA.crt
/usr/share/ca-certificates/lut/MYCASLinuxSUBCA.crt
So assuming that the variable $cas_server_ca_cert_path has to have one of these .crt files or .pem dirs (such a /usr/share/ca-certificates/lut/MYCASLinuxSUBCA.crt) I cannot make it work. What I am doing it wrong? My client-server (no the cas server) is in my localhost. Is it a problem? Should I avoid use setCasServerCACert command? Why is it happening?
I've also tried to use the curl-ca-bundle.crt certificate provided by my XAMP instalation (Xampp 1.8.3).
I am a little bit lost with certificates as you can see.
I read about problems with phpCAS and recent Ubuntu versions in https://github.com/Jasig/phpCAS/issues?state=open. However I cannot make this working with the master code, even without certification (by default).
Any ideas would be appreciated...
I have found the solution asking in the github library: https://github.com/Jasig/phpCAS/issues/119
The reason is that the curl binary used by PHP in my xampp installation is different from the system's curl binary. The system one has access to /etc/ssl/certs/ certificates, but the xampp curl does not have (unless you don't indicate it, of course). By default, it searches in a special certificate-bundle-file.
Finally I have found the real certificate for my cas-server and I am using it, however maybe you want to use other proposed solution at the end of the discussion thread if you are having a similar problem.

Mediawiki + Sub-domain + SSL returns 404 error when accessing secure site

Using CPanel/Softaculous to install Mediawiki on my hosted website appears to install fine. Though not sure how much the installer checks.
I then setup a sub-domain such as wiki.mydomain.com to accept requests there.
After that, I also setup SSL cert in Cpanel. The cert is self-signed because at the moment I am just testing out the wiki and everything before I decided if I will purchase a cert.
Then, if I attempt to go to http://wiki.mydomain.com. I get the landing page of MediaWiki but if I attempt to go to https://wiki.mydomain.com I get nothing but a blank browser window.
Now, if i go to https://wiki.mydomain.com/index.php, I get a 404 error (I created a simple html page with a 404 error message then modified my .htaccess to show it on the 404).
When looking at the logs, it appears to be trying to find the index.php file under /home/mydomain/public_html/index.php instead of /home/mydomain/wiki/index.php.
Very confused on why this isn't working at all. I can post some configs and things as well but this account is a newly created CPanel account so not much as been done on it other then installing the wiki software.
(Edit) This is using SharedSSL. I couldn't get it to work without it. Some reason even after I made sure the site was the only one on the IP Address using WHM it was still showing it as a shared IP. :P
Fixed the SharedSSL by using this information: Cpanel Forums
You will have to make a new install of MediaWiki via Softaculous. Go on the install form you will get an option to "Choose Protocol" choose https:// there and in the "Choose Domain" dropdown choose your subdomain https://wiki.mydomain.com leave the "In Directory" field blank and then click on Install button.
Then you should be able to access the MediaWiki install at https://wiki.mydomain.com
I think the reason for this issue is due to how cPanel works with sub-domains and SSL. From what I gather, this appears to be a SSL cert issue since when CPanel rebuilds the httpd.conf using /scripts/rebuildhttpdconf command, it does not create a SSL virtual host for the sub-domain. Also, the parent domain works fine.
I ended up putting the wiki in /home/mydomain/public_html/wiki then setting up redirects for http://mydomain.com and https://domain.com to point to https://mydomain.com/wiki.
For now, that's all I could figure out to fix the issue was to drop the sub-domain.

Categories