-! Copyright (c) 2008 Slava Pestov\r
+! Copyright (c) 2008, 2010 Slava Pestov\r
! See http://factorcode.org/license.txt for BSD license.\r
USING: accessors assocs namespaces kernel sequences sets\r
-destructors combinators fry logging\r
-io.encodings.utf8 io.encodings.string io.binary random\r
-checksums checksums.sha urls\r
+destructors combinators fry logging io.encodings.utf8\r
+io.encodings.string io.binary io.sockets.secure random checksums\r
+checksums.sha urls\r
html.forms\r
http.server\r
http.server.filters\r
swap >>default\r
users-in-db >>users\r
sha-256 >>checksum\r
- t >>secure ; inline\r
+ ssl-supported? >>secure ; inline\r
\r
: users ( -- provider )\r
realm get users>> ;\r
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel accessors combinators namespaces fry urls urls.secure
-http http.server http.server.redirection http.server.responses
+USING: kernel accessors combinators namespaces fry urls http
+http.server http.server.redirection http.server.responses
http.server.remapping http.server.filters furnace.utilities ;
IN: furnace.redirection
ARTICLE: "http.client" "HTTP client"
"The " { $vocab-link "http.client" } " vocabulary implements an HTTP and HTTPS client on top of " { $link "http" } "."
$nl
-"For HTTPS support, you must load the " { $vocab-link "urls.secure" } " vocab first. If you don't need HTTPS support, don't load " { $vocab-link "urls.secure" } "; this will reduce the size of images generated by " { $vocab-link "tools.deploy" } "."
+"For HTTPS support, you must load the " { $vocab-link "io.sockets.secure" } " vocab first. If you don't need HTTPS support, don't load " { $vocab-link "io.sockets.secure" } "; this will reduce the size of images generated by " { $vocab-link "tools.deploy" } "."
$nl
"There are two primary usage patterns, data retrieval with GET requests and form submission with POST requests:"
{ $subsections
-! Copyright (C) 2008 Slava Pestov.
+! Copyright (C) 2008, 2010 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel namespaces continuations destructors io
debugger io.sockets io.sockets.private sequences summary
SYMBOL: secure-socket-backend
+HOOK: ssl-supported? secure-socket-backend ( -- ? )
+
+M: object ssl-supported? f ;
+
SINGLETONS: SSLv2 SSLv23 SSLv3 TLSv1 ;
TUPLE: secure-config
-! Copyright (C) 2007, 2008, Slava Pestov, Elie CHAFTARI.
+! Copyright (C) 2007, 2010, Slava Pestov, Elie CHAFTARI.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors unix byte-arrays kernel sequences namespaces
math math.order combinators init alien alien.c-types
FROM: io.ports => shutdown ;
IN: io.sockets.secure.unix
+M: openssl ssl-supported? t ;
+
M: ssl-handle handle-fd file>> handle-fd ;
: syscall-error ( r -- * )
USE: vocabs.loader
{ "urls" "prettyprint" } "urls.prettyprint" require-when
+{ "urls" "io.sockets.secure" } "urls.secure" require-when
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs combinators hashtables http
http.client json.reader kernel macros namespaces sequences
-urls.secure fry oauth urls system ;
+io.sockets.secure fry oauth urls ;
IN: twitter
! Configuration
] with-scope ; inline
: twitter-url ( string -- string' )
- os windows?
- "http://twitter.com/"
- "https://twitter.com/" ? prepend ;
+ ssl-supported?
+ "https://twitter.com/" "http://twitter.com/" ? prepend ;
PRIVATE>