LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-17-2020, 10:11 AM   #16
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011

Clients don't need certificates to connect unless the server asks for one. Having said that, they do need to trust the server's cert chain though.
 
1 members found this post helpful.
Old 01-17-2020, 10:24 AM   #17
end
Member
 
Registered: Aug 2016
Posts: 266

Original Poster
Rep: Reputation: Disabled
if i remove certs from above server or S_server its the same error with this client.
 
Old 01-17-2020, 01:24 PM   #18
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
Quote:
Originally Posted by end View Post
hi with ERR_print_errors_fp(stderr); i get this error

Code:
139896906146304:error:1408F10B:SSL routines:ssl3_get_record:wrong version number
This usually means the handshake failed - some kind of mismatch in protocols maybe. You can look into why handshakes can fail.



Quote:
Originally Posted by end View Post
hi this is client im testing it with

openssl s_server accept 80 --cert /root/mycert.pem -ket /root/mycert.pem
I presume -ket is a typo?

No errors when you run this command?
 
1 members found this post helpful.
Old 01-17-2020, 02:02 PM   #19
end
Member
 
Registered: Aug 2016
Posts: 266

Original Poster
Rep: Reputation: Disabled
yes its typo, i can run command
 
Old 01-17-2020, 02:14 PM   #20
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
The error handling could be improved a bit, e.g.:
Code:
   if ((rett= connect(sockett, (struct sockaddr *)&server, sizeof(struct sockaddr_in))) < 0)
   {
     printf("connect(%d) failed, errno: %d %s\n",sockett, errno, strerror(errno));
     exit (2);
   }
Also please change this:
Code:
old: if(SSL_set_fd(ssl, rett)<=0)
new: if(SSL_set_fd(ssl, sockett)<=0)
Plus, please read this again and again, until you've learnt it by heart: https://www.cs.umd.edu/~srhuang/teac...al-handout.pdf

Last edited by NevemTeve; 01-17-2020 at 02:23 PM.
 
3 members found this post helpful.
Old 01-17-2020, 02:59 PM   #21
end
Member
 
Registered: Aug 2016
Posts: 266

Original Poster
Rep: Reputation: Disabled
Code:
old: if(SSL_set_fd(ssl, rett)<=0)
new: if(SSL_set_fd(ssl, sockett)<=0)
Solved thank you man. Finaly. i learn about error handling like i newer think iwill did.
 
  


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
vsFTPd - SSL connection and dynamic SSL ports toxoplasme Linux - Server 11 08-22-2008 10:50 PM
need help with apach virtual hosts ssl/non ssl sites danthach Linux - Networking 3 05-25-2006 06:40 AM
apache2 - ssl : connection via ssl interrupted ldp Linux - Software 0 10-02-2005 09:07 AM
Apache/SSL - works with Windows client but not Linux client RickHDYoung Linux - Security 1 07-01-2004 04:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:06 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