LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-23-2012, 03:52 PM   #1
phpdev
LQ Newbie
 
Registered: Nov 2011
Posts: 14

Rep: Reputation: Disabled
SSL: certificate subject name 'locladomain' does not match target host name XX.xx.xx.


Hello,

I am using cURL with php5.3 and try to post form using it to https url.
but when echo the error it says "SSL: certificate subject name 'localhost.localdomain' does not match target host name XX.XX.XX.XXX"

Is there anything to do with SSL certificate?

Any help will be great and appreciated.

Thank you
 
Old 03-23-2012, 04:03 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
This is the SSL error you'll get if you access an SSL/TLS protected resource using a name other than the certificate subject name.

You're trying to post from a process running on the same system, but obviously the certificate was not issued to "localhost.localdomain". Post to the correct hostname and the problem should disappear.

Edit: Sorry, it's actually worse: You do have a certificate issued to "localhost.localdomain", and you're trying to access the site using an IP address instead.

Anyway, you need to access the https site with the same name used to issue the SSL certificate. And that name should not be "localhost.localdomain".

Last edited by Ser Olmy; 03-23-2012 at 04:18 PM.
 
Old 03-26-2012, 09:21 AM   #3
phpdev
LQ Newbie
 
Registered: Nov 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
thank you for reply.

i am new to ssl
below link help me
http://wiki.centos.org/HowTos/Https

Last edited by phpdev; 03-26-2012 at 09:40 AM.
 
1 members found this post helpful.
Old 03-26-2012, 04:27 PM   #4
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
When you post to (or access in any way) a https url, the SSL/TLS process starts with the server giving the client a certificate. The client expects the name in the certificate to be identical to the server name in the URL.

In your case, you've installed a self-signed certificate. When you created a certificate signing request (CSR) with OpenSSL, you didn't specify a host name ('subject' in certificate-speak), so OpenSSL tried to autodetect the hostname. It found "localhost.localdomain", which is unfortunate, since that is a name that is used on all systems to reference the system itself. A proper domain name would have been better, but that's not the reason you're getting an SSL error.

The error message appears because you're accessing the https page using an IP address (https://xx.xx.xx.xx/someurl), not the host name (https://localhost.localdomain/someurl). Since the certificate wasn't (and cannot be) issued to an IP address, SSL negotiation fails.

Try using "localhost.localdomain" instead of the IP address. (And if that works, consider generating a new certificate issued to a proper hostname.)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to import/use CAcert SSL root certificate to use SSL with Xchat IRC client? GrapefruiTgirl Linux - Software 9 04-05-2011 09:54 AM
Apache with SSL does not load the 2nd SSL certificate janstapel Linux - Newbie 1 06-17-2010 09:32 PM
no chain/target match by that name slang830 Linux - Security 2 03-19-2007 09:26 AM
Certificate doesnt match host hua Linux - Server 2 01-21-2007 04:23 AM
no chain/target/match creznedmick Linux - Networking 1 03-08-2004 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration