summaryrefslogtreecommitdiff
path: root/src/openssl_stream.c
Commit message (Collapse)AuthorAgeFilesLines
* openssl: don't try to teardown an unconnected SSL contextcmn/ssl-nullCarlos Martín Nieto2015-09-301-1/+6
| | | | | | SSL_shutdown() does not like it when we pass an unitialized ssl context to it. This means that when we fail to connect to a host, we hide the error message saying so with OpenSSL's indecipherable error message.
* Merge pull request #3297 from tkelman/patch-2Carlos Martín Nieto2015-07-101-0/+2
|\ | | | | Fix undefined reference with old versions of openssl
| * Fix undefined reference with old versions of opensslTony Kelman2015-07-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Versions prior to 0.9.8f did not have this function, rhel/centos5 are still on a heavily backported version of 0.9.8e and theoretically supported until March 2017 Without this ifdef, I get the following link failure: ``` CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o: In function `openssl_connect': openssl_stream.c:(.text+0x45a): undefined reference to `SSL_set_tlsext_host_name' collect2: error: ld returned 1 exit status make[6]: *** [libgit2_clar] Error 1 ```
* | git_cert: child types use proper base typeEdward Thomson2015-07-101-2/+3
|/
* openssl: free hostnameEdward Thomson2015-06-291-0/+1
|
* Fixed build failure if GIT_CURL is not definedPierre-Olivier Latour2015-06-261-1/+1
|
* curl: remove the encrypted param to the constructorCarlos Martín Nieto2015-06-241-1/+1
| | | | | We do not want libcurl to perform the TLS negotiation for us, so we don't need to pass this option.
* openssl: use the curl stream if availableCarlos Martín Nieto2015-06-241-12/+110
| | | | | | | | When linking against libcurl, use it as the underlying transport instead of straight sockets. We can't quite just give over the file descriptor, as curl puts it into non-blocking mode, so we build a custom BIO so OpenSSL sends the data through our stream, be it the socket or curl streams.
* Merge pull request #3108 from libgit2/cmn/ssl-no-wantEdward Thomson2015-05-221-16/+5
|\ | | | | openssl: don't try to handle WANT_READ or WANT_WRITE
| * openssl: don't try to handle WANT_READ or WANT_WRITEcmn/ssl-no-wantCarlos Martín Nieto2015-05-091-16/+5
| | | | | | | | | | | | | | | | | | We use a blocking socket and set the mode to AUTO_RETRY which means that `SSL_write` and `SSL_read` will only return once the read or write has been completed. We therefore don't need to handle partial writes or re-try read due to a regenotiation. While here, consider that a zero also indicates an error condition.
* | Merge branch 'sni'Carlos Martín Nieto2015-05-211-0/+3
|\ \
| * | Call the openssl API to be able to work with SNI servers.Cristian Oneț2015-05-211-0/+3
| |/
* | errors: add GIT_EEOF to indicate early EOFcmn/server-errorsCarlos Martín Nieto2015-05-201-0/+1
|/ | | | | | This can be used by tools to show mesages about failing to communicate with the server. The error message in this case will often contain the server's error message, as far as it managed to send anything.
* Rename GIT_SSL to GIT_OPENSSLCarlos Martín Nieto2015-04-231-1/+1
| | | | | This is what it's meant all along, but now we actually have multiple implementations, it's clearer to use the name of the library.
* Silence unused warnings when not using OpenSSLCarlos Martín Nieto2015-04-231-0/+4
|
* Include openssl headers lastAki Koskinen2015-03-021-4/+4
| | | | | | | | | Windows headers #define some names that openssl uses too. Openssl headers #undef the offending names before reusing them. But if those offending Windows headers get included after the openssl headers the namespace is polluted and nothing good happens. Fixes issue #2850.
* Don't include headers on windows that aren't availableAki Koskinen2015-03-021-3/+6
| | | | This mainly concerns mingw build.
* openssl: Add all required includes for AF_INET6 and in6_addr.Raphael Kubo da Costa2015-01-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | This fixes the build at least on FreeBSD, where those types were not defined indirectly: src/openssl_stream.c:100:18: error: variable has incomplete type 'struct in6_addr' struct in6_addr addr6; ^ src/openssl_stream.c:100:9: note: forward declaration of 'struct in6_addr' struct in6_addr addr6; ^ src/openssl_stream.c:111:18: error: use of undeclared identifier 'AF_INET' if (p_inet_pton(AF_INET, host, &addr4)) { ^ src/unix/posix.h:31:40: note: expanded from macro 'p_inet_pton' ^ src/openssl_stream.c:115:18: error: use of undeclared identifier 'AF_INET6' if(p_inet_pton(AF_INET6, host, &addr6)) { ^ src/unix/posix.h:31:40: note: expanded from macro 'p_inet_pton' ^
* stream: constify the write bufferCarlos Martín Nieto2014-12-101-1/+1
|
* gitno: remove code which is no longer neededCarlos Martín Nieto2014-12-101-1/+2
| | | | | | Most of the network-facing facilities have been copied to the socket and openssl streams. No code now uses these functions directly anymore, so we can now remove them.
* Add an OpenSSL IO streamCarlos Martín Nieto2014-12-101-0/+374
This unfortunately isn't as stackable as could be possible, as it hard-codes the socket stream. This is because the method of using a custom openssl BIO is not clear, and we do not need this for now. We can still bring this in if and as we need it.