14 Commits

Author SHA1 Message Date
okhowang(王沛文)
b45a02efab sample: add https-client-mbedtls 2020-09-16 11:57:52 +08:00
okhowang(王沛文)
028385f685 fix build system and add test and cleanup code 2020-07-22 22:53:23 +03:00
yuangongji
78b5bca6d8 sample/https-client: link crypt32 explicitly when build with mingw-w64 2019-10-08 21:38:58 +08:00
Dan Rosen
2f184f8bbf evwatch: Add "prepare" and "check" watchers.
Adds two new callbacks: "prepare" watchers, which fire immediately
before we poll for I/O, and "check" watchers, which fire immediately
after we finish polling and before we process events. This allows other
event loops to be embedded into libevent's, and enables certain
performance monitoring.

Closes: #710
2019-04-03 12:44:50 -04:00
Azat Khuzhin
d5b24cc0c8
sample/becat: bufferevent cat, ncat/nc/telnet analog 2019-03-16 17:40:20 +03:00
Carlo Marcelo Arenas Belón
0ec5edde50 autotools: pass $(OPENSSL_INCS) for samples (FTBFS macOS)
if OpenSSL is in a non standard location, need to pass that information
to any sample that needs it

Closes: #550
2017-08-22 11:28:41 +03:00
Azat Khuzhin
1d34498ea3 sample: add HTTP CONNECT tunnelling example using libevent http layer 2015-08-18 12:59:50 +03:00
Mike Frysinger
0c492b33f9 add a --disable-samples configure flag
For people building & installing libevent in a distro, building all these
sample apps are not useful.  Add a flag to turn them off.
2014-06-13 17:19:50 -04:00
Patrick Pelletier
4db9da6bbf pull in wildcard matching code from cURL
Now, https-client accepts both:

https://ip.appspot.com/ (matching wildcard certificate)
https://github.com/     (matching non-wildcard certificate)

but still rejects

https://www.kegel.com/  (non-matching wildcard certificate)

which should match the behavior of these sites in a web browser.
2013-02-27 21:22:03 -08:00
Patrick Pelletier
64d9f161fe use iSECPartners code to validate hostname in certificate
The problem is that if you go to a website whose certificate does not
match its hostname, it should fail.  Try this in a web browser for
https://www.kegel.com/ for example.  Your web browser will say the
certificate is for *.pair.com, not for www.kegel.com, and won't let
you visit it without clicking through a bunch of scary warnings.

However, prior to this commit, https-client was happy to fetch
https://www.kegel.com/ without complaining.  That is bad.  Now, with
this commit, it will properly complain, which is good:

pelletier@chives:~/src/libevent/sample$ ./https-client https://www.kegel.com/
Got 'MatchNotFound' for hostname 'www.kegel.com' and certificate:
/C=US/postalCode=15203/ST=Pennsylvania/L=Pittsburgh/street=Suite 210/street=2403 Sidney Street/O=pair Networks, Inc./OU=Provided by pair Networks, Inc./OU=PairWildcardSSL $250,000/CN=*.pair.com
some request failed - no idea which one though!
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
ppelletier@chives:~/src/libevent/sample$

It will still succeed for sites with an exactly-matching certificate,
such as https://github.com/ and that is also good!

However, the problem is that the iSECPartners code doesn't handle
wildcards, which means we reject https://ip.appspot.com/ even though
it is perfectly legitimate, because we don't understand the wildcard:

ppelletier@chives:~/src/libevent/sample$ ./https-client https://ip.appspot.com/
Got 'MatchNotFound' for hostname 'ip.appspot.com' and certificate:
/C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.appspot.com
some request failed - no idea which one though!
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
ppelletier@chives:~/src/libevent/sample$

So, we need to fix this.  In other words, "to be continued..."
2013-02-27 21:22:03 -08:00
Patrick Pelletier
bf31fa5d30 use ${OPENSSL_LIBS} instead of -lssl -lcrypto
This made the difference between segfaulting and not segfaulting for
me when I run https-client, when I've built libevent using an OpenSSL
in a non-standard location.

In the same spirit as 1d9d5110a4aebf5833f6fd78bd0252affde0f4d0 and
d70af27d0152d0a87a25127faf215604beb8ffe0.
2013-02-27 21:22:03 -08:00
Catalin Patulea
be46c99b89 Add sample/https-client.c, an example of stacking evhttp as a client on top of bufferevent_ssl.
Signed-off-by: Catalin Patulea <catalinp@google.com>
2013-02-27 16:06:56 -08:00
Sebastian Hahn
9e8cdf3d65 Fix comment to refer to sample/include.am correctly 2012-12-23 18:41:00 +01:00
Nick Mathewson
6cdfeebebc Rename subordinate Makefile.ams to include.am 2012-08-28 16:01:14 -04:00