<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EAP/TLS TLS_accept error <BR>Hi:</DIV>
<DIV>&nbsp;</DIV>
<DIV>I want to build a IEEE 802.1x authentication environoment and </DIV>
<DIV>I have installed freeradius-1.0.2, openssl-0.9.8i, hostpad-0.4.8, wpa_supplicant-0.4.8. The authentication server is built in redhat9 ,</DIV>
<DIV>the database is mysql5 and client is build in linux.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I can use EAP/MD5 authentication type and it runs well.<BR>When I config EAP/TLS-MD5 type, the client cann't be authenticated.<BR>I have referenced many similar ways to resolve it, but I am failed.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I list my configuration files and the debug information below.<BR>Who can give me some suggestion, Thank your very much for your help !</DIV>
<DIV>&nbsp;</DIV>
<DIV>A. IN FREERADIUS:</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. Using CA.all to generate certificats:<BR>./CA.all<BR>Get those new files:<BR>cert-clt.der cert-clt.p12 cert-clt.pem<BR>cert-srv.p12 cert-srv.pem newcert.pem<BR>newreq.pem root.der root.p12 root.pem<BR>The default protect password is whaterver</DIV>
<DIV>2. Generate Diffie-Hellman key named dh and random key named random<BR>openssl dhparam -check -text -5 512 -out dh<BR>dd if=/dev/urandom of=random count=2</DIV>
<DIV>3. eap.conf<BR>default_eap_type = tls<BR>tls {<BR>private_key_password = whatever<BR>private_key_file = /etc/mycerts/cert-srv.pem<BR>certificate_file = /etc/mycerts/cert-srv.pem<BR>CA_file = /etc/mycerts/root.pem<BR>dh_file = /etc/mycerts/dh<BR>random_file = /etc/mycerts/random<BR>fragment_size = 1024<BR>include_length = yes<BR>}</DIV>
<DIV>4. radius.conf<BR>authorize {<BR>&nbsp;&nbsp;&nbsp; preprocess<BR>&nbsp;&nbsp;&nbsp; suffix<BR>&nbsp;&nbsp;&nbsp; eap<BR>&nbsp;&nbsp;&nbsp; files<BR>&nbsp;&nbsp;&nbsp; sql<BR>}<BR>authenticate {<BR>&nbsp;&nbsp;&nbsp; eap<BR>}</DIV>
<DIV>5. users<BR>DEFAULT Auth-Type = EAP<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fall-Through = 1</DIV>
<DIV>6. part of debug information<BR>modcall: entering group authenticate for request 1<BR>&nbsp; rlm_eap: Request found, released from the list<BR>&nbsp; rlm_eap: EAP/tls<BR>&nbsp; rlm_eap: processing type tls<BR>&nbsp; rlm_eap_tls: Authenticate<BR>&nbsp; rlm_eap_tls: processing TLS<BR>&nbsp; eaptls_verify returned 7 <BR>&nbsp; rlm_eap_tls: Done initial handshake<BR>&nbsp;&nbsp;&nbsp; (other): before/accept initialization <BR>&nbsp;&nbsp;&nbsp; TLS_accept: before/accept initialization <BR>&nbsp; rlm_eap_tls: &lt;&lt;&lt; TLS 1.0 Handshake [length 0061], ClientHello&nbsp; <BR>&nbsp;&nbsp;&nbsp; TLS_accept: SSLv3 read client hello A <BR>&nbsp; rlm_eap_tls: &gt;&gt;&gt; TLS 1.0 Handshake [length 004a], ServerHello&nbsp; <BR>&nbsp;&nbsp;&nbsp; TLS_accept: SSLv3 write server hello A <BR>&nbsp; rlm_eap_tls: &gt;&gt;&gt; TLS 1.0 Handshake [length 0822], Certificate&nbsp; <BR>&nbsp;&nbsp;&nbsp; TLS_accept: SSLv3 write certificate A <BR>&nbsp; rlm_eap_tls: &gt;&gt;&gt; TLS 1.0 Handshake [length 0071], CertificateRequest&nbsp; <BR>&nbsp;&nbsp;&nbsp; TLS_accept: SSLv3 write certificate request A <BR>&nbsp;&nbsp;&nbsp; TLS_accept: SSLv3 flush data <BR>&nbsp;&nbsp;&nbsp; TLS_accept:error in SSLv3 read client certificate A <BR>In SSL Handshake Phase <BR>In SSL Accept mode </DIV>
<DIV>&nbsp;Processing the authenticate section of radiusd.conf<BR>modcall: entering group authenticate for request 4<BR>&nbsp; rlm_eap: Request found, released from the list<BR>&nbsp; rlm_eap: EAP/tls<BR>&nbsp; rlm_eap: processing type tls<BR>&nbsp; rlm_eap_tls: Authenticate<BR>&nbsp; rlm_eap_tls: processing TLS<BR>&nbsp; eaptls_verify returned 7 <BR>&nbsp; rlm_eap_tls: Done initial handshake<BR>&nbsp; rlm_eap_tls: &lt;&lt;&lt; TLS 1.0 Alert [length 0002], fatal bad_certificate&nbsp; <BR>TLS Alert read:fatal:bad certificate <BR>&nbsp;&nbsp;&nbsp; TLS_accept:failed in SSLv3 read client certificate A </DIV>
<DIV>TLS_accept: SSLv3 write server done A <BR>&nbsp;&nbsp;&nbsp; TLS_accept: SSLv3 flush data <BR>&nbsp;&nbsp;&nbsp; TLS_accept:error in SSLv3 read client certificate A <BR>rlm_eap_tls: Done initial handshake<BR>&nbsp; rlm_eap_tls: &lt;&lt;&lt; TLS 1.0 Alert [length 0002], fatal bad_certificate&nbsp; <BR>TLS Alert read:fatal:bad certificate <BR>&nbsp;&nbsp;&nbsp; TLS_accept:failed in SSLv3 read client certificate A <BR>6533:error:14094412:SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate:s3_pkt.c:1052:SSL alert number 42<BR>6533:error:140940E5:SSL routines:SSL3_READ_BYTES:ssl handshake failure:s3_pkt.c:837:<BR>rlm_eap_tls: SSL_read failed in a system call (-1), TLS session fails.<BR>In SSL Handshake Phase <BR>In SSL Accept mode&nbsp; <BR>rlm_eap_tls: BIO_read failed in a system call (-1), TLS session fails</DIV>
<DIV>&nbsp;</DIV>
<DIV>B. IN HOSTAPD</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. some debug information<BR>RADIUS packet matching with station 00:13:d7:20:00:90<BR>IEEE 802.1X: 00:13:d7:20:00:90 BE_AUTH entering state FAIL<BR>IEEE 802.1X: Sending EAP Packet to 00:13:d7:20:00:90 (identifier 4)<BR>IEEE 802.1X: 00:13:d7:20:00:90 REAUTH_TIMER entering state INITIALIZE<BR>IEEE 802.1X: 00:13:d7:20:00:90 AUTH_PAE entering state HELD<BR>br0: STA 00:13:d7:20:00:90 IEEE 802.1X: authentication failed<BR>IEEE 802.1X: 00:13:d7:20:00:90 BE_AUTH entering state IDLE</DIV>
<DIV>&nbsp;</DIV>
<DIV>C. IN WPA_SUPPLICANT</DIV>
<DIV>&nbsp;</DIV>
<DIV>1. wired.conf<BR># IEEE 802.1X with EAP-TLS<BR>ctrl_interface=/var/run/wpa_supplicant<BR>ap_scan=0<BR>eapol_version=1</DIV>
<DIV>network={<BR>&nbsp;ssid=""<BR>&nbsp;key_mgmt=IEEE8021X<BR>&nbsp;eap=TLS<BR>&nbsp;identity="test"<BR>&nbsp;ca_cert="/root/root.pem"<BR>&nbsp;client_cert="/root/cert-clt.pem"<BR>&nbsp;private_key="/root/cert-clt.pem"<BR>&nbsp;private_key_passwd="whatever"<BR>&nbsp;eapol_flags=0<BR>&nbsp;priority=2<BR>}</DIV>
<DIV>2. some debug information<BR>SSL: SSL_connect:SSLv3 read server hello A<BR>TLS: Certificate verification failed, error 9 (certificate is not yet valid) depth 1 <BR>SSL: (where=0x4008 ret=0x22a)<BR>SSL: SSL3 alert: write (local SSL3 detected an error):fatal:bad certificate<BR>SSL: (where=0x1002 ret=0xffffffff)<BR>SSL: SSL_connect:error in SSLv3 read server certificate B<BR>OpenSSL: tls_connection_handshake - SSL_connect error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed<BR>SSL: 7 bytes pending from ssl_out<BR>SSL: Failed - tls_out available to report error</DIV>
<DIV>&nbsp;</DIV><br><!-- footer --><br> 
<hr>
<font style="font-size:12px;line-height:15px;">[广告] </font><font style="font-size:12px;line-height:15px;"></font><a style="font-size:12px;line-height:15px; color:blue; text-decoration:underline;" href="http://popme.163.com/link/003985_1010_7027.html">2008年最受关注楼盘</a>