(ns my-client.core
(:require [clj-http.client :as client]
[clojure.pprint :refer :all]))
(def my-appkey "...")
(defn login [username password appkey]
(client/post "https://.../api/certlogin"
{:headers {"X-Application" appkey
"Content-Type" "application/x-www-form-urlencoded"}
:form-params {"username" username "password" password}}))
(defn -main []
(pprint (login "..." "..." my-appkey)))
curl -q -k --cert client-2048.crt --key client-2048.key https://.../api/certlogin -d "username=...&password=..." -H "X-Application: ..."--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
(client/post "https://example.com" {:keystore "/path/to/keystore.ks" :keystore-type "jks" ; default: jks :keystore-pass "secretpass"})
openssl pkcs12 -export -in cert.pem -inkey "private_key.pem" -certfile cert.pem -out keystore.p12
keytool -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12 -destkeystore keystore.jks
keytool -import -alias ejbca -keystore keystore.jks -file VDPCA-Sandbox.pem -storepass password
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/Bh0gl5QEUsI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+unsubscribe@googlegroups.com.
Amazing, thank you James, thank you Micheal, it works!In Perl things are often pretty complex, but in this specific case the code is dead easy:my $client = REST::Client->new(cert => '/path/to/ssl.cert',key => '/path/to/ssl.key');my $response = $client->POST('https://.../api/certlogin','username=' . $username . '&password=' . $->password);-- Pierre Masci
(let [client (http/create-client
{:ssl-cert "/path/to/ssl.cert"
:ssl-key "/path/to/ssl.key"
:ssl-ca-cert "/path/to/ssl.cert"})]
(http/post client "https://.../api/certlogin"))