wip_SSLClientCreateOpts error codes


#1

I would like to use SSL to connect to an FTP sever (using WIP SSL Security Plug-in), I call wip_SSLInitOpts (which returns 0 = OK - is this correct?) then wip_SSLClientCreateOpts on which I receive a wip_event_t::WIP_CEV_ERROR with an event->content.error.errnum of 1: what does this error number mean? Any documentation on the possible return values for wip_SSLInitOpts and wip_SSLClientCreateOpts?

Is it possibe to use SSL with FTP (ftps)? How does one specify username and password?

(My FTP connection using wip_FTPCreateOpts works.)

Initialise lib:

int returnValue = wip_SSLInitOpts(WIP_COPT_CERT_AUTHORITY, CA_CERT_SERVER,
			WIP_COPT_VERIFY, WIP_SSL_ALWAYS,
			WIP_COPT_END);
	TraceMessage(Verbose, TRACEDETAIL, "wip_SSLInitOpts returned: %d", returnValue);

Create channel in lib:

//Create the FTP channel
		_ftpChannel = wip_SSLClientCreate( _ftpServer, 21, SessionHandler, NULL);
		//If channel not created, log an error
		if (!_ftpChannel)
		{
			TraceMessage(Error, TRACEDETAIL, "Could not create FTP channel: %x", _ftpChannel);
			return false;;
		}
		else
		{
			TraceMessage(Verbose, TRACEDETAIL, "FTP Channel Opening");
			_channelState = Opening;
			return true;
		}

#2

Hi,

Have you obtained the application note from SierraWireless website?
http://www.sierrawireless.com/en/sitecore/content/Sierra%20Wireless/Support/Downloads/AirPrime/Q_Series/AirPrime_Q2687.aspx

Namely:
Using FTP Over SSL.zip

Hope it helps.
L


#3

Thanks for the info L,

I have not had a look at the document - I am reading it now.


#4

I think that “event->content.error.errnum == 1” means “Certificate error” (Out of date, etc…)


#5

Hello,

I also would like to connect my Fxt009 to a secure server by using the SSL library (certificat + key) over Gprs.

I have copied the code of the SSL over FTP sierra application note and change the server name/port.

I always received erreur SSL, knowing that the certificat and key i am using are the correct one.

Can you help me?

see below the traces i have:

2012/10/03;14:52:21:752;007;ADL;1;[GPRS]: start: -> CONNECTING
2012/10/03;14:52:21:752;008;ADL;1;[GPRS]: GPRS CTX (cid=1) found
2012/10/03;14:52:21:752;009;ADL;1;[GPRS]: GPRS EVENT SETUP OK (cid=1): GPRS activate
2012/10/03;14:52:21:752;010;ADL;16;[ADL port] IsAvailable(80) : 1
2012/10/03;14:52:22:908;001;ADL;1;[GPRS]: GPRS CTX (cid=1) found
2012/10/03;14:52:22:908;002;ADL;1;[GPRS]: GPRS EVENT: 27 (cid=1)
2012/10/03;14:52:23:689;001;ADL;1;[GPRS]: GPRS CTX (cid=1) found
2012/10/03;14:52:23:689;002;ADL;1;[GPRS]: GPRS EVENT ACTIVATE OK (cid=1)
2012/10/03;14:52:23:689;003;ADL;1;[GPRS]: GPRS: -> CONNECTED
2012/10/03;14:52:23:689;004;ADL;1;(cbEvhBearer) Enter. Event 2
2012/10/03;14:52:23:689;005;ADL;1;(cbEvhBearer) IP connected
2012/10/03;14:52:23:689;006;ADL;1;[WIP] new TCPSERVER 0x18119fc0
2012/10/03;14:52:23:705;001;ADL;1;###
2012/10/03;14:52:23:705;002;ADL;1;[WIP] new TCPSERVER 0x1811a040
2012/10/03;14:52:23:705;003;ADL;1;null
2012/10/03;14:52:23:705;004;ADL;1;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2012/10/03;14:52:23:705;005;ADL;1;@@ WARNING! NO RANDOM SEED @@
2012/10/03;14:52:23:705;006;ADL;1;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
2012/10/03;14:52:23:720;001;ADL;1;null
2012/10/03;14:52:23:720;002;ADL;1;You haven’t provided a proper random seed with WIP_COPT_SEED.
2012/10/03;14:52:23:720;003;ADL;1;This is OK for tests, but it makes your key generation proccess
2012/10/03;14:52:23:720;004;ADL;1;guessable by opponents. Don’t release software without a truly
2012/10/03;14:52:23:720;005;ADL;1;random seed!
2012/10/03;14:52:23:720;006;ADL;1;null
2012/10/03;14:52:23:720;007;ADL;1;Bad seed
2012/10/03;14:52:23:736;001;ADL;1;[open_session] begin open_session function.
2012/10/03;14:52:23:752;001;NET;10;00 59 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 4b 00 01 00 00 40 11 8a f2 0a 12 10 c0 d4 e0 ff fc 04 00 00 35 00 37 85 8a 00 00 01 00 00 01 00 00 00 00 00 00 12 62 6f 73 69 6d 75 6c 61 74 6f 72 63 6c 61 6d 61 72 74 06 64 79 6e 64 6e 73
2012/10/03;14:52:23:752;002;ADL;1;[WIP] new TCPCLIENT 0x1811f0e0
2012/10/03;14:52:23:752;003;ADL;1;[open_session] Opening connection: in progress
2012/10/03;14:52:23:752;004;ADL;1;[open_session] end reopen_session function.
2012/10/03;14:52:23:752;005;ADL;1;Opening FTP connection…
2012/10/03;14:52:23:752;006;ADL;1;[WIP] new TCPCLIENT 0x1811bea0
2012/10/03;14:52:23:752;007;ADL;1;[WIP] new spawned TCPCLIENT 0x1811bf20
2012/10/03;14:52:23:767;001;ADL;1;[evh_server] Connection established successfully
2012/10/03;14:52:23:955;001;NET;10;00 c3 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 b5 7e 10 00 00 3c 11 10 79 d4 e0 ff fc 0a 12 10 c0 00 35 04 00 00 a1 d0 cc 00 00 81 80 00 01 00 01 00 05 00 00 12 62 6f 73 69 6d 75 6c 61 74 6f 72 63 6c 61 6d 61 72 74 06 64 79 6e 64 6e 73
2012/10/03;14:52:23:955;002;NET;10;00 3a 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 2c 00 05 00 00 40 06 c5 4f 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 01 00 00 00 00 60 02 5b 40 92 28 00 00 02 04 02 18
2012/10/03;14:52:24:439;001;NET;10;00 3a 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 2c 00 00 40 00 2f 06 96 54 6d 00 2d a6 0a 12 10 c0 00 de 04 01 17 2c 62 22 00 01 f4 02 60 12 16 d0 5a 01 00 00 02 04 05 50
2012/10/03;14:52:24:439;002;NET;10;00 36 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 28 00 06 00 00 40 06 c5 52 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 02 17 2c 62 23 50 10 5b 40 2c ea 00 00
2012/10/03;14:52:24:439;003;ADL;1;[SSL] subevh_handshake function
2012/10/03;14:52:24:439;004;ADL;1;[SSL] subevh_handshake function
2012/10/03;14:52:24:439;005;ADL;1;[SSL] subevh_handshake: WIP_CEV_OPEN
2012/10/03;14:52:24:439;006;ADL;15;[ADL RTC] convert (0) : 0
2012/10/03;14:52:24:439;007;ADL;15;[ADL RTC] convert (0) : 0
2012/10/03;14:52:24:439;008;NET;10;00 8d 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 7f 00 07 00 00 40 06 c4 fa 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 02 17 2c 62 23 50 18 5b 40 b0 d5 00 00 80 55 01 03 01 00 3c 00 00 00 10 00 00 16 00 00 13 00 00 0a 07 00 c0 00 00 05
2012/10/03;14:52:24:439;009;ADL;1;[SSL] Handshaking waiting for more network exchanges (state==0)
2012/10/03;14:52:25:142;001;NET;10;00 5d 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 4f fb 20 40 00 2f 06 9b 10 6d 00 2d a6 0a 12 10 c0 00 de 04 01 17 2c 62 23 00 01 f4 02 50 18 16 d0 0a 31 00 00 32 32 30 20 57 65 6c 63 6f 6d 65 20 74 6f 20 74 68 65 20 46 65 64 6f 72 61 20
2012/10/03;14:52:25:142;002;NET;10;00 36 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 28 00 08 00 00 40 06 c5 50 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 59 17 2c 62 4a 50 10 5b 19 2c 93 00 00
2012/10/03;14:52:25:142;003;ADL;1;[SSL] subevh_handshake function
2012/10/03;14:52:25:142;004;ADL;1;[SSL] subevh_handshake: WIP_CEV_OPEN
2012/10/03;14:52:25:142;005;ADL;15;[ADL RTC] convert (0) : 0
2012/10/03;14:52:25:142;006;ADL;1;[SSL] [BIO =>] read 7 bytes on TCP
2012/10/03;14:52:25:158;001;ADL;1;[SSL] SSL_ERROR_SSL
2012/10/03;14:52:25:158;002;ADL;1;[SSL] Serious connection error 1 (SSL state==0)
2012/10/03;14:52:25:158;003;ADL;1;###(evh_client): WIP_CEV_ERROR
2012/10/03;14:52:25:158;004;ADL;1;[evh_client] Error 1 on socket. Closing.
2012/10/03;14:52:25:158;005;ADL;1;[SSL] shutdown completed
2012/10/03;14:52:25:158;006;ADL;1;[WIP] closing CHANNEL 0x1811f1c0
2012/10/03;14:52:25:158;007;NET;10;00 36 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 28 00 09 00 00 40 06 c5 4f 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 59 17 2c 62 4a 50 11 5b 40 2c 6b 00 00
2012/10/03;14:52:25:158;008;ADL;1;[WIP] closing TCPCLIENT 0x1811f0e0
2012/10/03;14:52:25:173;001;NET;10;00 36 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 28 fb 21 40 00 2f 06 9b 36 6d 00 2d a6 0a 12 10 c0 00 de 04 01 17 2c 62 4a 00 01 f4 59 50 10 16 d0 70 dc 00 00
2012/10/03;14:52:25:173;002;NET;10;00 5c 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 4e fb 22 40 00 2f 06 9b 0f 6d 00 2d a6 0a 12 10 c0 00 de 04 01 17 2c 62 4a 00 01 f4 59 50 18 16 d0 0b 93 00 00 35 33 30 20 50 6c 65 61 73 65 20 6c 6f 67 69 6e 20 77 69 74 68 20 55 53 45 52
2012/10/03;14:52:25:173;003;NET;10;00 36 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 28 00 0a 00 00 ff 06 06 4e 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 59 00 00 00 00 50 04 00 00 01 2f 00 00
2012/10/03;14:52:25:689;001;NET;10;00 40 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 32 fb 23 40 00 2f 06 9b 2a 6d 00 2d a6 0a 12 10 c0 00 de 04 01 17 2c 62 70 00 01 f4 5a 50 18 16 d0 31 90 00 00 35 30 30 20 4f 4f 50 53 3a 20
2012/10/03;14:52:25:689;002;NET;10;00 36 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 28 00 0b 00 00 ff 06 06 4d 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 5a 00 00 00 00 50 04 00 00 01 2e 00 00
2012/10/03;14:52:25:704;001;NET;10;00 54 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 46 fb 24 40 00 2f 06 9b 15 6d 00 2d a6 0a 12 10 c0 00 de 04 01 17 2c 62 7a 00 01 f4 5a 50 18 16 d0 5d bd 00 00 76 73 66 5f 73 79 73 75 74 69 6c 5f 72 65 63 76 5f 70 65 65 6b 3a 20 6e 6f 20
2012/10/03;14:52:25:704;002;NET;10;00 36 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 28 00 0c 00 00 ff 06 06 4c 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 5a 00 00 00 00 50 04 00 00 01 2e 00 00
2012/10/03;14:52:25:720;001;NET;10;00 4e 20 52 45 43 56 85 20 52 45 43 56 85 08 00 45 00 00 40 fb 25 40 00 2f 06 9b 1a 6d 00 2d a6 0a 12 10 c0 00 de 04 01 17 2c 62 98 00 01 f4 5a 50 19 16 d0 1c 82 00 00 0d 0a 35 30 30 20 4f 4f 50 53 3a 20 63 68 69 6c 64 20 64 69 65 64 0d 0a
2012/10/03;14:52:25:720;002;NET;10;00 36 20 53 45 4e 44 85 20 53 45 4e 44 85 08 00 45 00 00 28 00 0d 00 00 ff 06 06 4b 0a 12 10 c0 6d 00 2d a6 04 01 00 de 00 01 f4 5a 00 00 00 00 50 04 00 00 01 2e 00 00