verify server certificate - php

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
ang3lusAsked:
Who is Participating?
 
ang3lusAuthor Commented:
my problem has been solved.
0
 
ang3lusAuthor 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
0
 
ang3lusAuthor Commented:
How can help ????
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
Julian HansenCommented:
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
0
 
ang3lusAuthor 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
0
 
ang3lusAuthor 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
0
 
Julian HansenCommented:
fine by me
0
 
ang3lusAuthor Commented:
I will close topic
I solved the problem

this link has helpful information
http://ca2.php.net/manual/en/book.curl.php
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.