{
    "content": [
        {
            "type": "text",
            "text": "# Net::SSLeay::Handle (perldoc)\n\n## NAME\n\nNet::SSLeay::Handle - Perl module that lets SSL (HTTPS) sockets be handled as standard file handles.\n\n## SYNOPSIS\n\nuse Net::SSLeay::Handle qw/shutdown/;\nmy ($host, $port) = (\"localhost\", 443);\ntie(*SSL, \"Net::SSLeay::Handle\", $host, $port);\nprint SSL \"GET / HTTP/1.0\\r\\n\";\nshutdown(\\*SSL, 1);\nprint while (<SSL>);\nclose SSL;\n\n## DESCRIPTION\n\nNet::SSLeay::Handle allows you to request and receive HTTPS web pages using \"old-fashion\" file\nhandles as in:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **FUNCTIONS**\n- **EXAMPLES**\n- **TODO**\n- **CAVEATS**\n- **CHANGES**\n- **BUGS**\n- **AUTHOR**\n- **COPYRIGHT**\n- **LICENSE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::SSLeay::Handle",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::SSLeay::Handle - Perl module that lets SSL (HTTPS) sockets be handled as standard file handles.",
        "synopsis": "use Net::SSLeay::Handle qw/shutdown/;\nmy ($host, $port) = (\"localhost\", 443);\ntie(*SSL, \"Net::SSLeay::Handle\", $host, $port);\nprint SSL \"GET / HTTP/1.0\\r\\n\";\nshutdown(\\*SSL, 1);\nprint while (<SSL>);\nclose SSL;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "use Net::SSLeay::Handle qw/shutdown/;",
            "my ($host, $port) = (\"localhost\", 443);",
            "tie(*SSL, \"Net::SSLeay::Handle\", $host, $port);",
            "print SSL \"GET / HTTP/1.0\\r\\n\";",
            "shutdown(\\*SSL, 1);",
            "print while (<SSL>);",
            "close SSL;"
        ],
        "see_also": [
            {
                "name": "perl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/perl/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 52,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "TODO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "CHANGES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::SSLeay::Handle - Perl module that lets SSL (HTTPS) sockets be handled as standard file\nhandles.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Net::SSLeay::Handle qw/shutdown/;\nmy ($host, $port) = (\"localhost\", 443);\n\ntie(*SSL, \"Net::SSLeay::Handle\", $host, $port);\n\nprint SSL \"GET / HTTP/1.0\\r\\n\";\nshutdown(\\*SSL, 1);\nprint while (<SSL>);\nclose SSL;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Net::SSLeay::Handle allows you to request and receive HTTPS web pages using \"old-fashion\" file\nhandles as in:\n\nprint SSL \"GET / HTTP/1.0\\r\\n\";\n\nand\n\nprint while (<SSL>);\n\nIf you export the shutdown routine, then the only extra code that you need to add to your\nprogram is the tie function as in:\n\nmy $socket;\nif ($scheme eq \"https\") {\ntie(*S2, \"Net::SSLeay::Handle\", $host, $port);\n$socket = \\*S2;\nelse {\n$socket = Net::SSLeay::Handle->makesocket($host, $port);\n}\nprint $socket $requestheaders;\n...\n",
                "subsections": []
            },
            "FUNCTIONS": {
                "content": "shutdown\nshutdown(\\*SOCKET, $mode)\n\nCalls to the main shutdown() don't work with tied sockets created with this module. This\nshutdown should be able to distinquish between tied and untied sockets and do the right\nthing.\n\ndebug\nmy $debug = Net::SSLeay::Handle->debug()\nNet::SSLeay::Handle->debug(1)\n\nGet/set debugging mode. Always returns the debug value before the function call. if an\nadditional argument is given the debug option will be set to this value.\n\nmakesocket\nmy $sock = Net::SSLeay::Handle->makesocket($host, $port);\n\nCreates a socket that is connected to $post using $port. It uses $Net::SSLeay::proxyhost and\nproxyport if set and authentificates itself against this proxy depending on\n$Net::SSLeay::proxyauth. It also turns autoflush on for the created socket.\n\nUSING EXISTING SOCKETS\nOne of the motivations for writing this module was to avoid duplicating socket creation code\n(which is mostly error handling). The calls to tie() above where it is passed a $host and $port\nis provided for convenience testing. If you already have a socket connected to the right host\nand port, S1, then you can do something like:\n\nmy $socket \\*S1;\nif ($scheme eq \"https\") {\ntie(*S2, \"Net::SSLeay::Handle\", $socket);\n$socket = \\*S2;\n}\nmy $lastsel = select($socket); $| = 1; select($lastsel);\nprint $socket $requestheaders;\n...\n\nNote: As far as I know you must be careful with the globs in the tie() function. The first\nparameter must be a glob (*SOMETHING) and the last parameter must be a reference to a glob\n(\\*SOMETHINGELSE) or a scaler that was assigned to a reference to a glob (as in the example\nabove)\n\nAlso, the two globs must be different. When I tried to use the same glob, I got a core dump.\n\nEXPORT\nNone by default.\n\nYou can export the shutdown() function.\n\nIt is suggested that you do export shutdown() or use the fully qualified\nNet::SSLeay::Handle::shutdown() function to shutdown SSL sockets. It should be smart enough to\ndistinguish between SSL and non-SSL sockets and do the right thing.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "use Net::SSLeay::Handle qw/shutdown/;\nmy ($host, $port) = (\"localhost\", 443);\n\ntie(*SSL, \"Net::SSLeay::Handle\", $host, $port);\n\nprint SSL \"GET / HTTP/1.0\\r\\n\";\nshutdown(\\*SSL, 1);\nprint while (<SSL>);\nclose SSL;\n",
                "subsections": []
            },
            "TODO": {
                "content": "Better error handling. Callback routine?\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "Tying to a file handle is a little tricky (for me at least).\n\nThe first parameter to tie() must be a glob (*SOMETHING) and the last parameter must be a\nreference to a glob (\\*SOMETHINGELSE) or a scaler that was assigned to a reference to a glob\n($s = \\*SOMETHINGELSE). Also, the two globs must be different. When I tried to use the same\nglob, I got a core dump.\n\nI was able to associate attributes to globs created by this module (like *SSL above) by making a\nhash of hashes keyed by the file head1.\n",
                "subsections": []
            },
            "CHANGES": {
                "content": "Please see Net-SSLeay-Handle-0.50/Changes file.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "If you encounter a problem with this module that you believe is a bug, please create a new issue\n<https://github.com/radiator-software/p5-net-ssleay/issues/new> in the Net-SSLeay GitHub\nrepository. Please make sure your bug report includes the following information:\n\n*   the code you are trying to run;\n\n*   your operating system name and version;\n\n*   the output of \"perl -V\";\n\n*   the version of OpenSSL or LibreSSL you are using.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Originally written by Jim Bowlin.\n\nMaintained by Sampo Kellomäki between July 2001 and August 2003.\n\nMaintained by Florian Ragwitz between November 2005 and January 2010.\n\nMaintained by Mike McCauley between November 2005 and June 2018.\n\nMaintained by Chris Novakovic, Tuure Vartiainen and Heikki Vatiainen since June 2018.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (c) 2001 Jim Bowlin <jbowlin@linklint.org>\n\nCopyright (c) 2001-2003 Sampo Kellomäki <sampo@iki.fi>\n\nCopyright (c) 2005-2010 Florian Ragwitz <rafl@debian.org>\n\nCopyright (c) 2005-2018 Mike McCauley <mikem@airspayce.com>\n\nCopyright (c) 2018- Chris Novakovic <chris@chrisn.me.uk>\n\nCopyright (c) 2018- Tuure Vartiainen <vartiait@radiatorsoftware.com>\n\nCopyright (c) 2018- Heikki Vatiainen <hvn@radiatorsoftware.com>\n\nAll rights reserved.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This module is released under the terms of the Artistic License 2.0. For details, see the\n\"LICENSE\" file distributed with Net-SSLeay's source code.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Net::SSLeay, perl(1), http://openssl.org/\n",
                "subsections": []
            }
        }
    }
}