Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails tests on OS X #15

Closed
djc opened this issue Aug 19, 2016 · 5 comments
Closed

Fails tests on OS X #15

djc opened this issue Aug 19, 2016 · 5 comments

Comments

@djc
Copy link
Member

djc commented Aug 19, 2016

It doesn't know how to find the CA certificate store on OS X, looks like:

---- online::no_cbc stdout ----
    We expected to find 'TLS error: AlertReceived(HandshakeFailure)' in the following output:
Output { status: ExitStatus(ExitStatus(25856)), stdout: "", stderr: "thread \'main\' panicked at \'cannot open CA file \'/etc/ssl/certs/ca-certificates.crt\': Error { repr: Os { code: 2, message: \"No such file or directory\" } }\nConsider using the --cafile option to provide a valid CA file.\', examples/tlsclient.rs:408\nnote: Run with `RUST_BACKTRACE=1` for a backtrace.\n" }
thread 'online::no_cbc' panicked at 'Test failed', tests/common/mod.rs:231
note: Run with `RUST_BACKTRACE=1` for a backtrace.
@djc
Copy link
Member Author

djc commented Aug 19, 2016

I did small amounts of digging. To get at the root certificates in OS X, you have to get them from KeyChain. https://github.com/sfackler/rust-security-framework seems to be a somewhat attractive way to get at them.

@ctz
Copy link
Member

ctz commented Aug 28, 2016

Should be fixed now as of 0.1.1.

@ctz ctz closed this as completed Aug 28, 2016
@djc
Copy link
Member Author

djc commented Aug 28, 2016

Much better! Still have a few failures, though:

---- client_auth_by_server_accepted stdout ----
    args ["--port", "9200", "--key", "test-ca/rsa/end.rsa", "--certs", "test-ca/rsa/end.fullchain", "--auth", "test-ca/rsa/client.chain", "http"]
connect: Connection refused
connect:errno=61
We expected to find 'Acceptable client certificate CA names' in the following output:
Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "connect: Connection refused\nconnect:errno=61\n" }
thread 'client_auth_by_server_accepted' panicked at 'Test failed', tests/common/mod.rs:583
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- client_auth_by_server_required stdout ----
    args ["--port", "9300", "--key", "test-ca/rsa/end.rsa", "--certs", "test-ca/rsa/end.fullchain", "--auth", "test-ca/rsa/client.chain", "--require-auth", "http"]
connect: Connection refused
connect:errno=61
We expected to find 'ssl handshake failure' in the following output:
Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "connect: Connection refused\nconnect:errno=61\n" }
thread 'client_auth_by_server_required' panicked at 'Test failed', tests/common/mod.rs:591

---- alpn_agree stdout ----
    args ["--port", "9100", "--key", "test-ca/rsa/end.rsa", "--certs", "test-ca/rsa/end.fullchain", "--proto", "connaught", "--proto", "bonjour", "--proto", "egg", "http"]
connect: Connection refused
connect:errno=61
We expected to find 'No ALPN negotiated' in the following output:
Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "connect: Connection refused\nconnect:errno=61\n" }
thread 'alpn_agree' panicked at 'Test failed', tests/common/mod.rs:583

@ctz ctz reopened this Aug 28, 2016
@ctz
Copy link
Member

ctz commented Sep 3, 2016

There are a few things here:

  • It appears the default 'openssl' on osx is 0.9.8-era. Now the tests on OSX will expect openssl at /usr/local/opt/openssl/bin/openssl (the default homebrew install location).
  • mio eventloop deregister fails on OSX if the socket is not registered, but doesn't on linux (mio issue Allow omitting SNI #351). In fact we don't need to deregister ever, so that's fixed.
  • shutdown(2) on OSX fails if the socket is already half-closed. We ignore these errors always now (because we close the socket shortly after).

There's now a travis OSX build so now it works it shouldn't break in the future :)

@ctz ctz closed this as completed Sep 3, 2016
@djc
Copy link
Member Author

djc commented Sep 4, 2016

Great stuff, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants