Posts

Showing posts with the label HTTPS

To use https (only) for Moodle with nginx

Image
To make your moodle instance work on https only is pretty simple with nginx: 1. Create a folder to contain the ssl certificate and key at /etc/nginx/ssl 2. Configure your nginx server block as following: 3. Create a simlink to the server block and restart nginx: $ sudo ln -s /etc/nginx/sites-available/mymoodlessl /etc/nginx/sites-enabled/mymoodlessl $ sudo service nginx restart 4. Add/modify these two lines to your moodle's config.php: $CFG->wwwroot   = 'https://mymoodle.com'; $CFG->sslproxy=true; 4. Do not enable " Use https for logins " in Site administration / ► Security / ► HTTP security 5. Done

PHP cURL with HTTPS

When using PHP cURL against a SSL powered website, you need to add this line (the red one) before calling curl_exec: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://my.domain.com'); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIEFILE, 'mycookie.txt'); curl_setopt($ch, CURLOPT_COOKIEJAR, 'mycookie.txt'); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $buffer = curl_exec($ch); (Notes that this is just a workaround, for proper fix please read this article: http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ )

To import SSL certificate and key into PowerSchool's database

In order to use the PowerSchool's API(s) or to enable Single Sign-on with 3rd-party app using SAML2, we need to enable HTTPS. To enable HTTPS on this application server, import a certificate and private key into the database. If you have already imported a certificate on this or any other application node, skip this procedure. If you do not yet have a certificate you will have the option to import and enable HTTPS at a later time If you choose to import, all certificates should be standard X509 certificates in standard Privacy Enhanced Mail (PEM) format. Viewed in a text editor, PEM format certificates start with "------BEGIN CERTIFICATE-----" and end with "-----END CERTIFICATE-----". The private key file should also be in PEM format . The private key password is the password you set when you generated the private key/certificate request pair. If your certificate authority provides an intermediate certificate or certificates, include them here. My private ...