2-way TLS Using HAProxy Authenticates with Command Line but Fails in Browser

jaredad7

For a proof of concept development, I have an HAProxy server running on my local machine (OSX) which is expecting to make a 2-way TLS with any client and then forward that client to a web server.

I followed this tutorial to get the authentication set up and this tutorial to create my own certificates. My haproxy config file looks like this:

global
    log 127.0.0.1 local1 notice

frontend intranet
    mode http
    log-format %T\ %t\ %U
    log global
    bind *:2000 ssl crt both.pem ca-file myCA.pem verify required
    default_backend helpdesk

backend helpdesk
    mode http
    server helpdesk 127.0.0.1:9000 check

both.pem has the private RSA key used to generate the root CA and the certificate itself, and myCA.pem is just the certificate. This works, but if there is a better way to do this, please let me know. It seems unnecessarily repetitive to include the certificate twice.

I can connect to the server using openssl s_client -connect 127.0.0.1:2000 -cert ./derived.crt -key ./derived.key. I can also connect by replacing the derived certificate and key with the root certificate and key. Both ways, I get a successful handshake and a connection to the web server on port 9000 (I can send GET and receive back html). For sanity, I also generated a second, unrelated root CA that fails to make the handshake.

I have tried adding both the derived CA and the root CA to my certificates, following the second tutorial's instructions. They get added and are trusted, but Safari still can't connect to the server. It tells me the server unexpectedly dropped the connection (I'm assuming this means the handshake failed or possibly wasn't even attempted). Chrome says it received an empty response.

I am going to try with postman to see if I can get back the same response that openssl gets when I fail (it explicitly tells me the handshake failed), but I wanted to ask this here in case I'm missing something simple that one of you knows about. Any help is greatly appreciated.

UPDATE: I see that I needed to add https:// to the beginning of the address. Now the browser asks me to choose which certificate to use. But, it only shows two certificates that are available by default in the system (certificates from work) and not my new one, which appears in the keychain list.

UPDATE 2: There are two different sections in the keychain for certificates. One is just called "Certificates." That's where my certificates go when I import them. The other is called "My Certificates," and it seems to be a subset of the "Certificates." I'm thinking if I can find a way to add my custom certificate here, then I can use it.

jaredad7

Problem was solved using a post I eventually found on Ask Different.

The command openssl pkcs12 -export -clcerts -inkey private.key -in certificate.crt -out MyPKCS12.p12 -name "Your Name" can be used to create a certificate that can be added to the keychain and then selected in Safari when the connection to the server is made.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Run php File in Browser from Command Line

분류에서Dev

How to reset router through command line browser?

분류에서Dev

Simplest way to send mail with image attachment from command line using gmail?

분류에서Dev

Runinng command on each line and export in the same way

분류에서Dev

Executing PHP gives error on command line interface, but works in browser

분류에서Dev

Rearrange PDF pages using the command-line

분류에서Dev

Diagnose internet connection issues using command line

분류에서Dev

Parse command line argument using argparse

분류에서Dev

Command Line Macros in Comments using SLURM

분류에서Dev

add hash to a file using command line

분류에서Dev

Sum numbers in filenames in a directory using command line

분류에서Dev

Renaming multiple folder using command line

분류에서Dev

Any way to access command line when desktop freezes?

분류에서Dev

Easy way to paste command line output to paste bin services?

분류에서Dev

Easiest way to push RabbitMQ events to browser using WebSockets in Python?

분류에서Dev

How to permanently disable monitor power saver using the command line?

분류에서Dev

Using custom extension (/x) in resharper 9.0 command line inspection

분류에서Dev

OpenCV with Python and Java support using cmake command line

분류에서Dev

Command line download large (500+mb) file using vbscript

분류에서Dev

How can I import a database using command line?

분류에서Dev

How to ZIP specific files from a folder using Winzip command line?

분류에서Dev

How to copy text from command line to clipboard without using the mouse?

분류에서Dev

Pulling out keywords using standard command line utilities?

분류에서Dev

Elasticsearch how to index text files using the command line

분류에서Dev

How to count the number of characters in a command line argument by using and creating a function

분류에서Dev

execute jar file in command line using third party jar

분류에서Dev

How to run regex find and replace using windows command line

분류에서Dev

How can I get a count of files in a directory using the command line?

분류에서Dev

How to check installation and version using command line for any package?

Related 관련 기사

  1. 1

    Run php File in Browser from Command Line

  2. 2

    How to reset router through command line browser?

  3. 3

    Simplest way to send mail with image attachment from command line using gmail?

  4. 4

    Runinng command on each line and export in the same way

  5. 5

    Executing PHP gives error on command line interface, but works in browser

  6. 6

    Rearrange PDF pages using the command-line

  7. 7

    Diagnose internet connection issues using command line

  8. 8

    Parse command line argument using argparse

  9. 9

    Command Line Macros in Comments using SLURM

  10. 10

    add hash to a file using command line

  11. 11

    Sum numbers in filenames in a directory using command line

  12. 12

    Renaming multiple folder using command line

  13. 13

    Any way to access command line when desktop freezes?

  14. 14

    Easy way to paste command line output to paste bin services?

  15. 15

    Easiest way to push RabbitMQ events to browser using WebSockets in Python?

  16. 16

    How to permanently disable monitor power saver using the command line?

  17. 17

    Using custom extension (/x) in resharper 9.0 command line inspection

  18. 18

    OpenCV with Python and Java support using cmake command line

  19. 19

    Command line download large (500+mb) file using vbscript

  20. 20

    How can I import a database using command line?

  21. 21

    How to ZIP specific files from a folder using Winzip command line?

  22. 22

    How to copy text from command line to clipboard without using the mouse?

  23. 23

    Pulling out keywords using standard command line utilities?

  24. 24

    Elasticsearch how to index text files using the command line

  25. 25

    How to count the number of characters in a command line argument by using and creating a function

  26. 26

    execute jar file in command line using third party jar

  27. 27

    How to run regex find and replace using windows command line

  28. 28

    How can I get a count of files in a directory using the command line?

  29. 29

    How to check installation and version using command line for any package?

뜨겁다태그

보관