facebook / hhvm

A virtual machine for executing programs written in Hack.
https://hhvm.com
Other
18.12k stars 2.98k forks source link

stream_socket_enable_crypto() not implemented for client sockets #1647

Closed mingtse closed 9 years ago

mingtse commented 10 years ago

stream's ssl and tls are not working in hhvm.

Running the openssl tests

http://gcov.php.net/viewer.php?version=PHP_5_3&func=tests&file=ext%2Fopenssl%2Ftests%2Fsni_001.phpt

None of them pass. HHVM exits with message:

HipHop Fatal error: Undefined function: stream_socket_enable_crypto

scannell commented 10 years ago

It looks stream_socket_enable_crypto has not been implemented yet. Feel free to submit a PR if you (or someone else reading this) gets to this before we do.

machris commented 10 years ago

im on hhvm-fastcgi + Laravel Im having same issue when trying to send mail SMTP via Mandrill gives stream_socket_enable_crypto error

mandersondesign commented 10 years ago

I would love to hear if any progress on this has been made. Unable to send email via Swiftmailer on our server using HHVM.

Thanks!

benjaminisawolfe commented 10 years ago

Ditto. It makes a number of interest libraries fail, like PHPMailer, for example.

c0h1b4 commented 10 years ago

Any progress on stream_socket_enable_crypto function to be available? If not is there any workarounds? I really need to use swiftmailer, but without TLS encryption, it is a no go for HHVM. Still using old, slow & reliable PHPFPM.

aosaginohi commented 10 years ago

Having the same problem with Xenforo it just gives a blank page whenever you try to signup at the point it does try to sent the registration email.

Seems everything else works so this is the only thing stopping me from fully being able to use Xenforo on hhvm.

Error: \nFatal error: Call to undefined function stream_socket_enable_crypto() in /public/library/Zend/Mail/Protocol/Smtp.php on line 206

GabrielGil commented 10 years ago

+1 from here!

ccalleu commented 10 years ago

same story, laravel on hhvm using swiftmailer library fails, +1

aranere commented 10 years ago

Same here.. Using Laravel with Swiftmailer.

erikcvisser commented 10 years ago

+1! Any way we can contribute?

SiebelsTim commented 10 years ago

@erikcvisser Sure. stream_socket_enable_crypto needs to be implemented.

Look into hphp/runtime/ext/stream/ext_stream.cpp for other stream functions.

PHP's implementation is at https://github.com/php/php-src/blob/088eedfaa186e79f6f86b814f50efc947350bf88/ext/standard/streamsfuncs.c#L1493

valentinhocher commented 10 years ago

+1 needed for apple apn push

asowers1 commented 10 years ago

+1 Is there an official work around for this?

c0h1b4 commented 10 years ago

Is this issue ever going to be addressed? If HHVM developers are not interested or think this is superfluous, please close this thread.

r3wt commented 10 years ago

of course they are not going to fix it. they only fix shit that benefits them. anything else they say "feel free to submit a pull request"

r3wt commented 10 years ago
\nFatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host smtp.mandrillapp.com [Connection timed out #110]' in /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:274\nStack trace:\n#0 /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(64): Swift_Transport_StreamBuffer->_establishSocketConnection()\n#1 /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(115): Swift_Transport_StreamBuffer->initialize()\n#2 /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Mailer.php(80): Swift_Transport_AbstractSmtpTransport->start()\n#3 /usr/share/nginx/html/test.php(14): Swift_Mailer->send()\n#4 {main}
\nFatal error: Uncaught exception 'Swift_TransportException' with message 'Connection could not be established with host smtp.mandrillapp.com [Connection timed out #110]' in /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:274\nStack trace:\n#0 /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(64): Swift_Transport_StreamBuffer->_establishSocketConnection()\n#1 /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(115): Swift_Transport_StreamBuffer->initialize()\n#2 /usr/share/nginx/html/giannis/api/swiftmailer/lib/classes/Swift/Mailer.php(80): Swift_Transport_AbstractSmtpTransport->start()\n#3 /usr/share/nginx/html/test.php(14): Swift_Mailer->send()\n#4 {main}

I can successfully reproduce the problem

`

fredemmott commented 10 years ago

Sorry; while we currently have 7 people working full-time on improving HHVM for non-Facebook users, this currently isn't at the top of the pile - we try to prioritize based on balancing how popular a request is vs how long it's likely to take to implement/test. This is becoming a popular issue, so it's fairly likely to be re-prioritized once some of our current projects finish.

JoelMarcey commented 10 years ago

This functionality is something that takes longer than it might appear on the surface, given the sensitivity of the security implications around SSL and TLS. We just don't what to throw a half-baked implementation out to the world for something of this nature.

emlynwest commented 10 years ago

This would be a useful feature for fuelphp/email so :+1: from fuelphp

JJJ commented 9 years ago

Ran into this with Stripe's API: https://github.com/stripe/stripe-php/blob/master/lib/Stripe/ApiRequestor.php#L365

cgoosey1 commented 9 years ago

+1 Also I don't think 'of course they are not going to fix it. they only fix shit that benefits them' is a great attitude to have @r3wt . If you want something bad enough then do the hard work for it, don't blame others for their lack of time/resources.

arjun0819 commented 9 years ago

+1 I have the same problem.

MarkVink commented 9 years ago

+1 Ran into this problem as well.

Call to undefined function stream_socket_enable_crypto() in /home/forge/...../vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php on line 95

soee commented 9 years ago

+1 Confirmed, Laravels mail functions does not work because of this.

hossein-jazayeri commented 9 years ago

+1 We also got the exception with PHPMailer: "call to undefined function..."

JoelMarcey commented 9 years ago

Subscribing @Zenexer

bkrausz commented 9 years ago

@johnjamesjacoby FYI we added a shortcut to work around it in the latest Stripe bindings: https://github.com/stripe/stripe-php/blob/master/lib/Stripe/ApiRequestor.php#L351-L352. As soon as HHVM has support for this we'll also do a version check to add the blacklist validation back in.

JJJ commented 9 years ago

@bkrausz That'll do nicely. Thanks!

fredemmott commented 9 years ago

@bkrausz : function_exists('stream_socket_enable_crypto') or similar might be a better forward-compatible workaround

65 commented 9 years ago

+1

giano commented 9 years ago

+1

fredemmott commented 9 years ago

@siyengar might be taking a look at this :)

jaredjones commented 9 years ago

Can we get some more love for this issue? I realize this is open source software and free but this project is so huge none of us know where to even begin implementing this. Not to mention you guys would likely never accept a pull request from the community when it deals with security.

fredemmott commented 9 years ago

See my previous comment - we hopefully have someone working on it soon.

We would accept a pull request for this, but it would need reviewing by Facebook's security team (as would an internal implementation).

JoelMarcey commented 9 years ago

We love pull requests on pretty much anything that isn't implemented or bug laden. We may have to go through some extra layers of review + back and forth on security critical stuff, but that shouldn't stop you from submitting a pull request. At the very least, it might gives whoever works on something internally ideas or a starting point.

All pull requests won't all get accepted, of course, but they will all be considered for sure.

This one in particular we know is wanted by a lot of people and is hi-pri.

deivisonarthur commented 9 years ago

+1

tomykho commented 9 years ago

+1

jaredjones commented 9 years ago

+1*10^∞

fredemmott commented 9 years ago

We're hoping to have someone start work on this within the next couple of weeks - hopefully we'll have more news soon.

tdanielcox commented 9 years ago

+1, thanks for taking the time to fix this issue. You guys are really pushing PHP to the next level

johanroure commented 9 years ago

only dont use TLS encryption and that will fix the problem or you can send your emails with zend engine

danieldecsi commented 9 years ago

+1

siyengar commented 9 years ago

Hey guys, thanks for your interest. I'm planning to work on this in December when things quiet down here as well with other projects.

iveoles commented 9 years ago

+1

andrewhalls commented 9 years ago

+1

cjthomp commented 9 years ago

+1

steelbrain commented 9 years ago

+1

ghost commented 9 years ago

there's no need to keep +1ing this. if you want to get notifications for when this issue is resolved, then use the subscribe button on the right side of this page.

jaredjones commented 9 years ago

+1

yuhanz commented 9 years ago

+1