We help IT Professionals succeed at work.

verify server certificate - php

Medium Priority
417 Views
Last Modified: 2012-08-14
Hi

I hosted many php pages on server that has expired certificate.
my question is:
how i can verify server certificate is expired then notify user that certificate in this page is expired. and display dialog box if he continue or refuse use php


thanks
Comment
Watch Question

Author

Commented:
clarification:
because pages hold on server that had expired certificate the page should get the certificate error.  How i can handle this problem and instead display message for user if he want to continue or not


thanks

Author

Commented:
How can help ????
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
If I understand your question correctly you want the user to be shown a dialog if the certificate has expired to show them that the cert has expired and give them the option to continue or exit?

Does the browser not do this automatically the way it does if you browse to a site with self signed cert?

Also, have you had a look at the CURL library and the VERIFYPEER flag - does this help?

If not please can you explain a bit more what you are needing to do exactly

Author

Commented:
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER,0);
actually, i use curl but which function in curl library help me to get expire date for certificate
then create dialog message for user that certificate is end

thanks

Author

Commented:
after i use curl i can get certificate error
but i want to now how i can handle it

i would like to show message for user there is error in certificate and i ask him if he wanna process request with expire certificate  if answer yes then i send other curl with valid certificate to display output

if user choose no ---> logout

thanks
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
fine by me

Author

Commented:
I will close topic
I solved the problem

this link has helpful information
http://ca2.php.net/manual/en/book.curl.php
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.