Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Need some help with socket programming.

Need some help with socket programming.

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharpcryptographytutorial
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Soumya92
    wrote on last edited by
    #1

    I am using VB.net, but samples in any language will do. The problem is that I have to connect to a secure site with an invalid certificate. Every browser based control fails, so I have turned to raw sockets. The website is for internal use only, however its certificate is unverified. I need to know what commands to send and how to respond over https. My socket app, so far, can connect to http, and even view pages. On https, any command like GET /url?parameters HTTP/1.1 gives me an empty response. Thanks in advance.

    ~ Soumya92

    M 1 Reply Last reply
    0
    • S Soumya92

      I am using VB.net, but samples in any language will do. The problem is that I have to connect to a secure site with an invalid certificate. Every browser based control fails, so I have turned to raw sockets. The website is for internal use only, however its certificate is unverified. I need to know what commands to send and how to respond over https. My socket app, so far, can connect to http, and even view pages. On https, any command like GET /url?parameters HTTP/1.1 gives me an empty response. Thanks in advance.

      ~ Soumya92

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Have you tried using ServicePointManager.ServerCertificateValidationCallback[^]?

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      S 1 Reply Last reply
      0
      • M Mark Salsbery

        Have you tried using ServicePointManager.ServerCertificateValidationCallback[^]?

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        S Offline
        S Offline
        Soumya92
        wrote on last edited by
        #3

        I tried that now, and it works. But now I cannot send any POST commands.

        ~ Soumya92

        M 1 Reply Last reply
        0
        • S Soumya92

          I tried that now, and it works. But now I cannot send any POST commands.

          ~ Soumya92

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Soumya92 wrote:

          now I cannot send any POST commands

          What do you mean "cannot"?

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          S 1 Reply Last reply
          0
          • M Mark Salsbery

            Soumya92 wrote:

            now I cannot send any POST commands

            What do you mean "cannot"?

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            S Offline
            S Offline
            Soumya92
            wrote on last edited by
            #5

            Everytime I POST data to the server, a webexception is thrown: The underlying connection was closed.

            ~ Soumya92

            M 1 Reply Last reply
            0
            • S Soumya92

              Everytime I POST data to the server, a webexception is thrown: The underlying connection was closed.

              ~ Soumya92

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              Soumya92 wrote:

              a webexception is thrown

              WHAT exception? Is the server configured to not accept POST?

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              S 1 Reply Last reply
              0
              • M Mark Salsbery

                Soumya92 wrote:

                a webexception is thrown

                WHAT exception? Is the server configured to not accept POST?

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                S Offline
                S Offline
                Soumya92
                wrote on last edited by
                #7

                "The underlying connection was closed" The site works fine in a browser, once you get past the security error, so I assume that the server does accept post. Is it somehow possible to ignore the certificate errors for the webbrowser control?

                ~ Soumya92

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups