# Https not working - bad certifcate

**URL:** <https://forum.sierrawireless.com/t/https-not-working-bad-certifcate/4914>\
**Category:** Open AT\
**Created:** [February 22, 2011, 9:42pm UTC](https://forum.sierrawireless.com/t/https-not-working-bad-certifcate/4914 "2011-02-22T21:42:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![godzilla2007](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@godzilla2007](https://forum.sierrawireless.com/u/godzilla2007)\
**Post date:** [February 22, 2011, 9:42pm UTC](https://forum.sierrawireless.com/t/https-not-working-bad-certifcate/4914/1 "2011-02-22T21:42:45Z")

</div>

Hi,

I’m trying the example code as described in the application note, “P\_SSL\_Communication\_with\_Apache\_Server\_Application\_Note” which uses https but on my Apache server setup on my PC, I get an error with the handshake or the certificate.

In the debug screen, I get the following:

> [@](#):
>
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
> @@ WARNING! SSL VERIFICATION FAILURE @@  
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
> Failure reason: X509\_V\_ERR\_CERT\_NOT\_YET\_VALID  
> [SSL] SSL\_ERROR\_SSL  
> [SSL] Serious connection error 1 (SSL state==0)  
> [req\_event] WIP\_CEV\_ERROR  
> [HTTP] error 1 @ 180cbfdc  
> [HTTP] channel closed by server  
> http\_ClientTestDataHandler: ERROR  
> [WIP] closing CHANNEL 0x180cc1fc  
> [WIP] closing HTTP\_DATA 0x180cbfdc  
> [HTTP] destroy request @ 180cbfdc  
> [WIP] closing TCPCLIENT 0x180c8f1c

On the command prompt, I get the following error:

> [@](#):
>
> C:\Program Files\Apache Software Foundation\Apache2.2\bin\>openssl  
> OpenSSL\> s\_server -accept 6502 -cert server-cert.pem -key server-key.pem -CAfile  
> ca-cert.pem -www  
> Loading ‘screen’ into random state - done  
> Using default temp DH parameters  
> Using default temp ECDH parameters  
> ACCEPT  
> bad gethostbyaddr  
> 6924:error:14094412:SSL routines:SSL3\_READ\_BYTES:sslv3 alert bad certificate:.\s  
> sl\s3\_pkt.c:1102:SSL alert number 42  
> 6924:error:140780E5:SSL routines:SSL23\_READ:ssl handshake failure:.\ssl\s23\_lib.  
> c:142:  
> ACCEPT

Does anyone know how to resolve this?

Cheers  
Paul

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [February 23, 2011, 6:44am UTC](https://forum.sierrawireless.com/t/https-not-working-bad-certifcate/4914/2 "2011-02-23T06:44:08Z")

</div>

Use a certificate that is valid!!

---

<div class="post-metadata">

**Author:** ![godzilla2007](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@godzilla2007](https://forum.sierrawireless.com/u/godzilla2007)\
**Post date:** [February 23, 2011, 9:48pm UTC](https://forum.sierrawireless.com/t/https-not-working-bad-certifcate/4914/3 "2011-02-23T21:48:02Z")

</div>

I know it obvious by the Openssl response but the certificate is the one provided by the https example. I am under the impression the example should work and be use to get something running especially for someone using the security library for the first time.

I have also done a comparison with the keys for both the Q26 https example and the pem files and they are the same.

I will generate my own certificate and re-test it.

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [February 23, 2011, 11:12pm UTC](https://forum.sierrawireless.com/t/https-not-working-bad-certifcate/4914/4 "2011-02-23T23:12:48Z")

</div>

> [@godzilla2007](#):
>
> I am under the impression the example should work

Unfortunately, this is all too frequently not the case - see, for eaxmple: [Where is wip\_drv\_eth.h - #7 by awneil](https://forum.sierrawireless.com/t/where-is-wip-drv-eth-h/4908/7)

---

<div class="post-metadata">

**Author:** ![godzilla2007](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@godzilla2007](https://forum.sierrawireless.com/u/godzilla2007)\
**Post date:** [February 27, 2011, 9:03am UTC](https://forum.sierrawireless.com/t/https-not-working-bad-certifcate/4914/5 "2011-02-27T09:03:40Z")

</div>

I’ve just got the FAE (based oversea) to test the WIP SSL sample code and it to connects to my openssl server without any problem but when I try the code on my development kit, it does not work correctly. Still the same bad certificate and handshaking fault. The only difference between my hardware and the FAE is the modem (Q2686 and Q2687).
