Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 5 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
1  .gitignore
@@ -2,3 +2,4 @@
.*sw*
*.jar
*.class
+pom.xml
View
108 pom.xml
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>diamondap</groupId>
- <artifactId>clj-apache-https</artifactId>
- <version>1.0.18</version>
- <name>clj-apache-https</name>
- <description>Clojure HTTP library using the Apache HttpClient. Based on clj-apache-http, but includes support for SSL client certificates and HttpAsyncClient.</description>
- <scm>
- <connection>scm:git:git://github.com/diamondap/clj-apache-http.git</connection>
- <developerConnection>scm:git:ssh://git@github.com/diamondap/clj-apache-http.git</developerConnection>
- <tag>2b7274061fce6500a4faf8fc6ac1c293f73d1c68</tag>
- <url>https://github.com/diamondap/clj-apache-http</url>
- </scm>
- <build>
- <sourceDirectory>src</sourceDirectory>
- <testSourceDirectory>test</testSourceDirectory>
- <resources>
- <resource>
- <directory>resources</directory>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>test-resources</directory>
- </testResource>
- </testResources>
- </build>
- <repositories>
- <repository>
- <id>hotelicopter_releases</id>
- <url>https://raw.github.com/g1nn13/maven/master/releases</url>
- </repository>
- <repository>
- <id>hotelicopter_snapshots</id>
- <url>https://raw.github.com/g1nn13/maven/master/snapshots</url>
- </repository>
- <repository>
- <id>snapshots</id>
- <url>file:///Users/adiamond/projects/maven/snapshots</url>
- </repository>
- <repository>
- <id>releases</id>
- <url>file:///Users/adiamond/projects/maven/releases</url>
- </repository>
- <repository>
- <id>central</id>
- <url>http://repo1.maven.org/maven2</url>
- </repository>
- <repository>
- <id>clojars</id>
- <url>http://clojars.org/repo/</url>
- </repository>
- </repositories>
- <dependencies>
- <dependency>
- <groupId>swank-clojure</groupId>
- <artifactId>swank-clojure</artifactId>
- <version>1.3.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.clojure</groupId>
- <artifactId>clojure</artifactId>
- <version>1.2.1</version>
- </dependency>
- <dependency>
- <groupId>org.clojure</groupId>
- <artifactId>data.json</artifactId>
- <version>0.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>4.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpmime</artifactId>
- <version>4.1.1</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpasyncclient</artifactId>
- <version>4.0-alpha2</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.5</version>
- </dependency>
- </dependencies>
-</project>
-
-<!-- This file was autogenerated by Leiningen.
- Please do not edit it directly; instead edit project.clj and regenerate it.
- It should not be considered canonical data. For more information see
- https://github.com/technomancy/leiningen -->
View
9 project.clj
@@ -1,4 +1,4 @@
-(defproject revelytix/clj-apache-https "1.0.19-SNAPSHOT"
+(defproject revelytix/clj-apache-https "1.0.19"
:description "Clojure HTTP library using the Apache HttpClient. Based on clj-apache-http, but includes support for SSL client certificates and HttpAsyncClient."
:dependencies [[org.clojure/clojure "1.3.0"]
@@ -9,5 +9,8 @@
[org.apache.httpcomponents/httpclient "4.1.1"]
[org.apache.httpcomponents/httpasyncclient "4.0-alpha2"]
[commons-codec "1.5"]]
- :dev-dependencies [[swank-clojure "1.3.0-SNAPSHOT"]]
- :aot :all)
+
+ :dev-dependencies [[swank-clojure "1.4.0"]]
+ :source-path "src"
+ :compile-path "target/classes"
+ :library-path "lib")
View
6 src/com/twinql/clojure/NaiveTrustManager.clj
@@ -40,16 +40,16 @@
;; is trusted.
;;
(defn -checkClientTrusted
- [#^NaiveTrustManager this #^"[LX509Certificate;" chain #^String auth-type]
+ [^com.twinql.clojure.NaiveTrustManager this ^"[Ljava.security.cert.X509Certificate;" chain ^String auth-type]
"Always returns nil, never throws CertificateException"
nil)
(defn -checkServerTrusted
- [#^NaiveTrustManager this #^"[LX509Certificate;" chain #^String auth-type]
+ [^com.twinql.clojure.NaiveTrustManager this ^"[Ljava.security.cert.X509Certificate;" chain ^String auth-type]
"Always returns nil, never throws CertificateException"
nil)
-(defn #^"[LX509Certificate;" -getAcceptedIssuers [#^NaiveTrustManager this]
+(defn ^"[Ljavax.net.ssl.X509Certificate;" -getAcceptedIssuers [^com.twinql.clojure.NaiveTrustManager this]
"Always returns nil"
nil)
View
8 src/com/twinql/clojure/PermissiveHostnameVerifier.clj
@@ -20,20 +20,20 @@
:constructors {[] []}))
(defn -verify
- [#^PermissiveHostnameVerifier this #^String host #^SSLSocket socket]
+ [^com.twinql.clojure.PermissiveHostnameVerifier this ^String host ^javax.net.ssl.SSLSocket socket]
"Always returns null"
(println "Called first version")
nil)
(defn -verify
- [#^PermissiveHostnameVerifier this #^String host
- #^"[String;" cns #^"[String;" subjectAlts]
+ [^com.twinql.clojure.PermissiveHostnameVerifier this ^String host
+ ^String cns ^String subjectAlts]
"Always returns null"
(println "Called second version")
nil)
(defn -verify
- [#^PermissiveHostnameVerifier this #^String host #^X509Certificate cert]
+ [^com.twinql.clojure.PermissiveHostnameVerifier this ^String host ^java.security.cert.X509Certificate cert]
"Always returns null"
(println "Called third version")
nil)
View
32 src/com/twinql/clojure/async_client.clj
@@ -56,7 +56,7 @@
(:require [com.twinql.clojure.async-libs :as async]))
-(def #^AllowAllHostnameVerifier allow-all-hostname-verifier
+(def ^AllowAllHostnameVerifier allow-all-hostname-verifier
(AllowAllHostnameVerifier.))
@@ -96,26 +96,26 @@
(defrecord InternalExceptionHandler
[fn]
org.apache.http.nio.reactor.IOReactorExceptionHandler
- (#^boolean handle [this #^IOException ex] (fn ex))
- (#^boolean handle [this #^RuntimeException ex] (fn ex)))
+ (^boolean handle [this ^IOException ex] (fn ex))
+ (^boolean handle [this ^RuntimeException ex] (fn ex)))
(defrecord KeepAliveStrategy
- [#^long milliseconds]
+ [^long milliseconds]
org.apache.http.conn.ConnectionKeepAliveStrategy
(getKeepAliveDuration [this response context] milliseconds))
-(defn #^CountDownLatch countdown-latch
+(defn ^CountDownLatch countdown-latch
"Returns a CountdownLatch for managing async IO. Param num-requests must
specify the number of http requests that the callback will be handling."
[num-requests]
(CountDownLatch. num-requests))
-(defn #^DefaultConnectingIOReactor io-reactor
+(defn ^DefaultConnectingIOReactor io-reactor
"Returns a new instance of
org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor"
- [#^Integer worker-count
- #^IOReactorExceptionHandler internal-exception-handler
- #^org.apache.http.params.HttpParams params]
+ [^Integer worker-count
+ ^IOReactorExceptionHandler internal-exception-handler
+ ^org.apache.http.params.HttpParams params]
(let [reactor (DefaultConnectingIOReactor. worker-count params)]
(if (not (nil? internal-exception-handler))
(. reactor setExceptionHandler
@@ -151,7 +151,7 @@
http-params)
-(defn #^SyncBasicHttpParams create-http-params
+(defn ^SyncBasicHttpParams create-http-params
"Returns an HttpParams object with the specified settings. To make your life
easier, use com.twinql.clojure.http/map->params to construct a map with
friendly param names. For example:
@@ -173,17 +173,17 @@
http-params))
-(defn #^PoolingClientConnectionManager pooling-conn-manager
+(defn ^PoolingClientConnectionManager pooling-conn-manager
"Returns a PoolingClientConnectionManager"
- [#^org.apache.http.nio.reactor.ConnectingIOReactor ioreactor
- #^org.apache.http.nio.conn.scheme.SchemeRegistry registry
- #^long time-to-live]
+ [^org.apache.http.nio.reactor.ConnectingIOReactor ioreactor
+ ^org.apache.http.nio.conn.scheme.SchemeRegistry registry
+ ^long time-to-live]
(PoolingClientConnectionManager. ioreactor
registry
time-to-live
TimeUnit/MILLISECONDS))
-(def *default-opts*
+(def ^:dynamic *default-opts*
{:worker-threads 1
:hostname-verifier allow-all-hostname-verifier
:time-to-live 4000
@@ -192,7 +192,7 @@
-(defn #^PoolingClientConnectionManager connection-manager
+(defn ^PoolingClientConnectionManager connection-manager
"Returns a PoolingClientConnectionManager with the specified options.
Param options is a hash-map that may include the following. Any unset
vars will default to the value in *default-opts*.
View
23 src/com/twinql/clojure/async_libs.clj
@@ -28,24 +28,25 @@
AllowAllHostnameVerifier)
(org.apache.http.nio.conn.scheme
Scheme
- SchemeRegistry)))
+ SchemeRegistry
+ LayeringStrategy)))
-(defn #^SSLLayeringStrategy layering-strategy
+(defn ^SSLLayeringStrategy layering-strategy
"Returns a new LayeringStrategy for managing SSL connections."
- [#^SSLContext ssl-context #^X509HostnameVerifier hostname-verifier]
+ [^SSLContext ssl-context ^X509HostnameVerifier hostname-verifier]
(let [verifier (or hostname-verifier (AllowAllHostnameVerifier.))]
(SSLLayeringStrategy. ssl-context verifier)))
-(defn #^Scheme scheme
+(defn ^Scheme scheme
"Returns a new org.apache.http.nio.conn.scheme.Scheme. Param name should
be \"http\" or \"https\". Param port is the port to connect to on the
remote host."
- [#^String name #^long port #^LayeringStrategy strategy]
+ [^String name ^long port ^LayeringStrategy strategy]
(Scheme. name port strategy))
-(defn #^Scheme default-http-scheme []
+(defn ^Scheme default-http-scheme []
(Scheme. "http" 80 nil))
(defn #^Scheme default-https-scheme []
@@ -53,18 +54,18 @@
(.init ctx nil nil nil)
(Scheme. "https" 443 (SSLLayeringStrategy. ctx))))
-(defn #^SchemeRegistry default-scheme-registry []
+(defn ^SchemeRegistry default-scheme-registry []
(doto (SchemeRegistry.)
(. register (default-http-scheme))
(. register (default-https-scheme))))
-(defn #^org.apache.http.nio.conn.scheme.SchemeRegistry scheme-registry
+(defn ^org.apache.http.nio.conn.scheme.SchemeRegistry scheme-registry
"Creates a scheme registry using the given socket factory to connect
on the port you specify. This scheme registry is suitable for the async
http client."
- [#^SSLSocketFactory socket-factory #^Long port
- #^SSLLayeringStrategy ssl-layering-strategy]
- (let [#^SchemeRegistry scheme-registry (SchemeRegistry.)]
+ [^SSLSocketFactory socket-factory ^Long port
+ ^SSLLayeringStrategy ssl-layering-strategy]
+ (let [^SchemeRegistry scheme-registry (SchemeRegistry.)]
(.register scheme-registry (Scheme. "https" port ssl-layering-strategy))
scheme-registry))

No commit comments for this range

Something went wrong with that request. Please try again.