• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

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
0
ang3lus
Asked:
ang3lus
  • 6
  • 2
1 Solution
 
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
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
ang3lusAuthor Commented:
my problem has been solved.
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now