小编old*_*ide的帖子

Python SSL模块:如何打开调试以详细显示握手

在 Perl 中,我可以做

perl -MIO::Socket::SSL=debug4 my_program.pl
Run Code Online (Sandbox Code Playgroud)

这将详细显示 SSL 握手

DEBUG: .../IO/Socket/SSL.pm:2649: new ctx 98842176
DEBUG: .../IO/Socket/SSL.pm:562: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:564: socket connected
DEBUG: .../IO/Socket/SSL.pm:586: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:619: using SNI with hostname fundresearch.fidelity.com
DEBUG: .../IO/Socket/SSL.pm:654: request OCSP stapling
DEBUG: .../IO/Socket/SSL.pm:673: set socket to non-blocking to enforce timeout=180
DEBUG: .../IO/Socket/SSL.pm:686: call Net::SSLeay::connect
DEBUG: .../IO/Socket/SSL.pm:689: done Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:699: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:709: waiting for fd to become ready: SSL wants a read first …
Run Code Online (Sandbox Code Playgroud)

python ssl handshake

7
推荐指数
0
解决办法
714
查看次数

Powershell Remove-Item not working from a function

I needed to replace the Alias 'cd' with my function named 'cd'.

I tried to remove the alias from a function, but it didn't work. The following was a simple testing script,

function remove_alias {
    get-command cd
    Remove-Item -Path Alias:cd
    get-command cd
}    
remove_alias
Run Code Online (Sandbox Code Playgroud)

I ran it from Windows 10 and native Powershell version 5.1.18362.752. The output was below. The alias didn't change

PS> . .\test_remove_alias.ps1

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           cd -> Set-Location
Alias           cd …
Run Code Online (Sandbox Code Playgroud)

powershell alias

5
推荐指数
1
解决办法
1239
查看次数

在Perl中,如何将打印函数分配给变量?

我需要使用变量控制打印方法

我的代码如下

#!/usr/bin/perl

# test_assign_func.pl
use strict;
use warnings;

sub echo {
   my ($string) = @_;
   print "from echo: $string\n\n";
}  

my $myprint = \&echo;
$myprint->("hello");

$myprint = \&print;
$myprint->("world");
Run Code Online (Sandbox Code Playgroud)

当我运行时,我收到以下打印函数分配错误

$ test_assign_func.pl
from echo: hello

Undefined subroutine &main::print called at test_assign_func.pl line 17.
Run Code Online (Sandbox Code Playgroud)

看起来我需要为打印函数添加命名空间前缀,但我找不到命名空间。谢谢您的任何建议!

perl namespaces

1
推荐指数
1
解决办法
288
查看次数

标签 统计

alias ×1

handshake ×1

namespaces ×1

perl ×1

powershell ×1

python ×1

ssl ×1