walkor / walkor/workerman

增加个方法以支持自定义$crypto_type呗

Open
#893 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
11.6k
Forks
2.2k
Avg merge
11h 30m
Merged PRs (30d)
3

Description

目前$type 是写死的,给个方法支持自定义呗。
```php
public function doSslHandshake($socket){
if (\feof($socket)) {
$this->destroy();
return false;
}
$async = $this instanceof AsyncTcpConnection;

/**
* We disabled ssl3 because https://blog.qualys.com/ssllabs/2014/10/15/ssl-3-is-dead-killed-by-the-poodle-attack.
* You can enable ssl3 by the codes below.
*/
/*if($async){
$type = STREAM_CRYPTO_METHOD_SSLv2_CLIENT | STREAM_CRYPTO_METHOD_SSLv23_CLIENT | STREAM_CRYPTO_METHOD_SSLv3_CLIENT;
}else{
$type = STREAM_CRYPTO_METHOD_SSLv2_SERVER | STREAM_CRYPTO_METHOD_SSLv23_SERVER | STREAM_CRYPTO_METHOD_SSLv3_SERVER;
}*/

if($async){
$type = \STREAM_CRYPTO_METHOD_SSLv2_CLIENT | \STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
}else{
$type = \STREAM_CRYPTO_METHOD_SSLv2_SERVER | \STREAM_CRYPTO_METHOD_SSLv23_SERVER;
}
....
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the doSslHandshake($socket) method shown in the issue and read how the current $type is selected for asynchronous and non-asynchronous connections. Trace how SSL settings are configured, then make the crypto method selectable and verify that both connection paths use the configured value.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.