ssl and tcp connect,

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ssl and tcp connect,

Michael Luich
Hello everyone,
    I have an app that i'm cross compiling from linux to windows with mingw. All goes well until ssl tries to connect a tcp_connect. It can't seem to resolve the address. I'm at a loss t explain why. Included is the apps includes and the connect line:

#ifndef BUILD_DLL
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#else
#include <windows.h>
#include <wininet.h>
#include <ws2tcpip.h>
#endif

#include "srsecure.h"
#include </usr/include/openssl/evp.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include <openssl/rand.h>

#define HOST    "ravenhair.is-a-geek.com"


static char *host=HOST;


    /* Connect the TCP socket*/
    sock=tcp_connect(host,port);

Mike Luich

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ssl and tcp connect,

Tor Lillqvist
> Included is the apps includes

Showing us that is mostly pointless, as it is obvious that you are
including the right headers if you get the thing to compile;)

> and the connect line

>     /* Connect the TCP socket*/
>     sock=tcp_connect(host,port);

Unfortunately showing us just that line is also mostly pointless, as
we have no idea what this tcp_connect() function does (besides the
obvious implied by its name).

The first thing I can think of that might be wrong is this: Do you
call WSAStartup() before any other WinSock functions? Even if the
WinSock API looks and feels a lot like the normal "BSD" socket API
used on Unixes, there are some like differences, like that you have to
call an initialisation function, WSAStartup(), first.

--tml

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ssl and tcp connect,

Michael Luich
Ahh,,

Yeah, it's a ported app, and I'm not doing any window specific setup. I'll look deeper into that.

Mike

On Tue, Oct 28, 2008 at 4:00 AM, Tor Lillqvist <[hidden email]> wrote:
> Included is the apps includes

Showing us that is mostly pointless, as it is obvious that you are
including the right headers if you get the thing to compile;)

> and the connect line

>     /* Connect the TCP socket*/
>     sock=tcp_connect(host,port);

Unfortunately showing us just that line is also mostly pointless, as
we have no idea what this tcp_connect() function does (besides the
obvious implied by its name).

The first thing I can think of that might be wrong is this: Do you
call WSAStartup() before any other WinSock functions? Even if the
WinSock API looks and feels a lot like the normal "BSD" socket API
used on Unixes, there are some like differences, like that you have to
call an initialisation function, WSAStartup(), first.

--tml

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
MinGW-users mailing list
[hidden email]

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users