dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: How can I use proxy in OpenSSL?

  1. #1
    Join Date
    Oct 2010
    Location
    Russia
    Posts
    69

    Question How can I use proxy in OpenSSL?

    How can I add ability for OpenSSL client to connect to OpenSSL server via proxy?

  2. #2
    Join Date
    Nov 2003
    Posts
    1,902

    Re: How can I use proxy in OpenSSL?

    https://www.openssl.org/docs/manmast.../s_client.html

    Look at the openssl(.exe) code and see what it does with the -proxy option.

    gg

  3. #3
    Join Date
    Oct 2010
    Location
    Russia
    Posts
    69

    Re: How can I use proxy in OpenSSL?

    Here is my connection code
    Code:
    int openConnection(const char *hostName, int port)
    {
        struct hostent *host;
        struct sockaddr_in addr;
     
        if ((host = gethostbyname(hostName)) == nullptr) {
            perror(hostName);
            abort();
        }
    
        int sd = socket(PF_INET, SOCK_STREAM, 0);
        memset(&addr, 0, sizeof(addr));
        addr.sin_family = AF_INET;
        addr.sin_port = htons(port);
        addr.sin_addr.s_addr = *(long*)(host->h_addr);
    
        if (connect(sd, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
            closesocket(sd);
            perror(hostName);
            abort();
        }
    
        return sd;
    }
    Where do I have to use this option?

  4. #4
    Join Date
    Nov 2003
    Posts
    1,902

    Re: How can I use proxy in OpenSSL?

    Look at the openssl(.exe) code and see what it does with the -proxy option.

    gg

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)