diff --git a/lib/auth.js b/lib/auth.js
index <HASH>..<HASH> 100644
--- a/lib/auth.js
+++ b/lib/auth.js
@@ -128,6 +128,7 @@ function loginFromNode (endpoint, config) {
     const options = {
       method: 'HEAD',
       hostname: parsedUrl.hostname,
+      port: parsedUrl.port,
       path: parsedUrl.path,
       timeout: 5000,
       key: keyBuf,
diff --git a/test/auth.js b/test/auth.js
index <HASH>..<HASH> 100644
--- a/test/auth.js
+++ b/test/auth.js
@@ -132,6 +132,26 @@ describe('TLS Client Authentication', () => {
             expect(user).to.be.null
           })
       })
+
+      it('respects the hostname, port, and path when sending the request', () => {
+        const requestStub = sinon.stub()
+          .callsArgWith(1, { headers: {} })
+          .returns({
+            on: sinon.stub(),
+            end: sinon.stub()
+          })
+
+        const login = proxyquire('../lib/auth', { https: { request: requestStub } }).login
+
+        return login({ authEndpoint: 'https://localhost:8443/', key: keyFilename, cert: certFilename })
+          .then(() => {
+            expect(requestStub).to.have.been.calledWithMatch({
+              hostname: 'localhost',
+              port: '8443',
+              path: '/'
+            })
+          })
+      })
     })
   })
Respect port from provided endpoint on node login