0

I tested Mini Proxy but it showed a complete blank page when I tried viewing https pages. I was told to add these 2 lines after "$ch = curl_init();" and it worked and I am able to view https pages on my web proxy.

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 

However reading a little bit more on cURL, I realize that, those 2 lines are risky as my web proxy would not verify the SSL certificates.

Q1. And so, what steps to follow and what lines of codes to add so that my web proxy verifies the SSL certificates using all the CAs that all modern browsers use to verify certificates and digital signatures ? What must I do now to add the certificate verification feature ?

Q2. I need to add a bad words filter so if a user tries viewing webpages that contain the bad words in it's content, then the web proxy must not load the webpage but must echo error instead. I will try writing and adding the filter if I can be sure to which line I should add the filter. Currently, I am stuck to which line it should be added on the Mini Proxy.

Mini Proxy's source code by Jost Dick, can be found on the following link from where I downloaded it: https://github.com/joshdick/miniProxy/blob/master/miniProxy.php

Can someone be kind enough to let me know on which line I should add the bad words filter and which variable I should be adding the filter on ?

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Possible duplicate of [PHP - SSL certificate error: unable to get local issuer certificate](https://stackoverflow.com/questions/28858351/php-ssl-certificate-error-unable-to-get-local-issuer-certificate) – Dharman Jun 07 '19 at 16:47
  • This is no duplicate entry! –  Jun 07 '19 at 17:56
  • It could be. I wasn't sure myself. In the first part of the question you seem to be unsure how to cope with missing certificate bundle, which the linked answer should help with. If you could make the question more clear I would appreciate. – Dharman Jun 07 '19 at 17:59
  • @darman, I was testing Mini Proxy. It failed to load httpS pages. I was told by a programmer to add the following 2 lines after "$ch = curl_init();" and so I added them: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); Reading up on cURL, I realize I never should verify PEERS or HOSTS like that by blindly accepting any SSL certificates from any website as they can be spoofed. Therefore, need to write a few lines of codes so the script verifies the certificates with the help of popular CAs before accepting them as genuine. –  Jun 08 '19 at 18:06
  • ... continued @darman, And, I also need to know on which line (in Mini Proxy), I should add the "Banned Words Filter" code of mine (once I've written it) and which variable (in Mini Proxy) should the filter deal with. I am talking about the variable that holds the content of the proxy fetched page. –  Jun 08 '19 at 18:08

0 Answers0