nrepl / nrepl/drawbridge

connection fails with status 401: Is Drawbridge not promoting to HTTPS properly?

Open
#43 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
192
Forks
13
PR merge metrics
No merged PRs in 30d

Description

I see the following when I try to connect to my app on Heroku. Local connection on http to the dev box is fine, however. Since it says that the protocol is HTTP here I wonder if that's the problem.

$ lein repl :connect https://USER:PASS@APP.herokuapp.com/repl
Connecting to nREPL at https://USER:PASS@APP.herokuapp.com/repl
ExceptionInfo clj-http: status 401 {:cached nil, :request-time 839,
:repeatable? false, :protocol-version {:name "HTTP", :major 1, :minor
1}, :streaming? true, :http-client
#object[org.apache.http.impl.client.InternalHttpClient 0x7573c7b5
"org.apache.http.impl.client.InternalHttpClient@7573c7b5"], :chunked?
false, :type :clj-http.client/unexceptional-status, :reason-phrase
"Unauthorized", :headers {"Server" "Aleph/0.4.4", "Via" "1.1 vegur",
"Content-Type" "text/plain", "X-Content-Type-Options" "nosniff",
"Content-Length" "13", "X-Frame-Options" "DENY",
"Strict-Transport-Security" "max-age=31536000; includeSubDomains",
"Www-Authenticate" "Basic realm=\"restricted area\"", "Connection"
"close", "Date" "Wed, 11 Mar 2020 18:02:20 GMT", "X-Xss-Protection"
"1; mode=block"}, :orig-content-encoding nil, :status 401, :length 13,
:body #object[clj_http.core.proxy$java.io.FilterInputStream$ff19274a
0x717a8a76
"clj_http.core.proxy$java.io.FilterInputStream$ff19274a@717a8a76"],
:trace-redirects []}
	slingshot.support/stack-trace (support.clj:201)
	clj-http.client/exceptions-response (client.clj:245)
	clj-http.client/exceptions-response (client.clj:236)
	clj-http.client/wrap-exceptions/fn--4637 (client.clj:254)
	clj-http.client/wrap-accept/fn--4883 (client.clj:737)
	clj-http.client/wrap-accept-encoding/fn--4890 (client.clj:759)
	clj-http.client/wrap-content-type/fn--4877 (client.clj:720)
	clj-http.client/wrap-form-params/fn--4986 (client.clj:961)
	clj-http.client/wrap-nested-params/fn--5007 (client.clj:995)
	clj-http.client/wrap-flatten-nested-params/fn--5016 (client.clj:1019)
	clj-http.client/wrap-method/fn--4944 (client.clj:895)
	clj-http.cookies/wrap-cookies/fn--1862 (cookies.clj:131)
Bye for now!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Heroku request with the provided lein repl :connect https://.../repl command and compare it with the working local HTTP connection. Inspect Drawbridge's Ring handler and its HTTPS or authentication request handling; the issue is done when an authenticated Heroku HTTPS connection no longer returns 401.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
api, backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.