TCP socket option not working in Windows Server 2016 Standard - sockets

This code workes fine in my Windows 10, Windows 11, Windows Server 2012R2 and Windows Server 2019 Standard:
TcpClient _client = new TcpClient();
_client.Client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 16);
... but ir does not work in Windows Server 2016 Standard x64. I get this error:
"An unknown, invalid, or unsupported option or level was specified in
a getsockopt or setsockopt call."
Any idea why this doesn't work on Windows Server 2016?

Related

How to connect VS code to a Linux VPS server?

Debian 11
I can login into cmd .
I added ssh key to VM so my ssh prompt doesn't require password.
still shows
Could not establish connection to "server IP". listen EADDRNOTAVAlL: address not available 127.0.0.1
Tried connect with root and password and IP but only for cmd but not vs code
More bug information:
[02:40:59.055] listen EADDRNOTAVAIL: address not available 127.0.0.1
[02:40:59.057] Resolver error: Error: listen EADDRNOTAVAIL: address not available 127.0.0.1
at g.ServerInstallError (c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:584081)
at h (c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:577310)
at t.handleInstallOutput (c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:581290)
at t.tryInstall (c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:680758)
at async c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:643114
at async t.withShowDetailsEvent (c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:646432)
at async t.resolve (c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:644164)
at async c:\Users\chenr5-INS\.vscode\extensions\ms-vscode-remote.remote-ssh-0.96.0\out\extension.js:1:721750
[02:40:59.069] ------
Use Remote Development Extension
Which include:
Remote - SSH - Work with source code in any location by opening
folders on a remote machine/VM using SSH. Supports x86_64, ARMv7l
(AArch32), and ARMv8l (AArch64) glibc-based Linux, Windows 10/Server
(1803+), and macOS 10.14+ (Mojave) SSH hosts.

Java client aborts on SNI unrecognized_name warning

I am trying to connect the domain platform.modsolar.net using socket. But I am getting
javax.net.ssl.SSLProtocolException: handshake alert:
unrecognized_name
I am using Java 7.
The host name(platform.modsolar.net) is correctly listed in the SANs
What am I missing here ?

webservice consumption in Domino - getting cross certificate error

User D.Bugger on this portal has resolved this issue however did not have more details how he resolved it. So it is great if he can answer or anyone can help who faced this and resolved it.
We are configuring Web service consumption on Domino server. For that purpose we exported remote server Root Certificate and imported on Domino JVM by referring: http://www-01.ibm.com/support/docview.wss?uid=swg21588966 also we imported certificate on Lotus Notes client and IE browser however we are still facing same error of cross certification as below when webagent runs. So we really need to create cross certificate on Domino directory for remote server as we are accessing remote server's service. Do we have any exact steps that we need to follow (some admin guide or so) to achieve this?
Server log:
12/16/2014 12:22:40 PM Opened session for Domino/SVR (Release 8.5)
12/16/2014 12:22:40 PM HTTP JVM: Error ; nested exception is:
12/16/2014 12:22:40 PM HTTP JVM: Error connecting to 'something.thing.com' on port '443', SSL invalid certificate, may need to cross-certify.
12/16/2014 12:22:40 PM HTTP JVM: WebServiceEngineFault
12/16/2014 12:22:40 PM HTTP JVM: faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
12/16/2014 12:22:40 PM HTTP JVM: faultSubcode:
12/16/2014 12:22:40 PM HTTP JVM: faultString: Error connecting to 'something.thing.com' on port '443', SSL invalid certificate, may need to cross-certify.
12/16/2014 12:22:40 PM HTTP JVM: faultActor:
12/16/2014 12:22:40 PM HTTP JVM: faultNode:
12/16/2014 12:22:40 PM HTTP JVM: faultDetail:
12/16/2014 12:22:40 PM HTTP JVM: Error connecting to 'something.thing.com' on port '443', SSL invalid certificate, may need to cross-certify.
Had a similar problem before. As far as I see, this might be related to a known issue, related with an faulty behaviour in the SSL client of some server tasks (SMTP, DA, WebService Consumer, etc.).
http://www-01.ibm.com/support/docview.wss?uid=swg21673152
Here, an IBM engineer explains the problem:
http://www-10.lotus.com/ldd/ndseforum.nsf/xpTopicThread.xsp?documentId=384D0763885F710385257CBD005E5919
This SPR deals with an issue where the Domino server is acting as the
SSL client. After the SSL server has sent the server certificate and
server key exchange messages, the SSL server can optionally request a
certificate from the SSL client, specifying a list of distinguished
names of acceptable certificate authorities. In some instances, no DN
list of acceptable certificate authorities is specified by the SSL
server.
Currently, in this case (where the SSL server is requesting a client
certificate from Domino but does not specify the acceptable
certificate authorities), the Domino server will respond with a fatal
alert and end the SSL handshake. In a future fix, the Domino server
will send a non-fatal SSL alert or the cert that it has, depending on
the customer's preference.
However, it seems like fixed in 9.0.1 FP2.
http://www-10.lotus.com/ldd/fixlist.nsf/Public/1CFEB3634431FC6685257C5C0047848B?OpenDocument
My Issue is resolved.
No need to create cross certificate in domino or not even in javacert. We had to just merge remote site Root Certificate to our Domino server's keyfile.kyr file from Certificate Admin Server database. This solution suggested by IBM person.
Still thanks for your support.
Cheers!!

SwiftMailer connection established error

I have problem with sending mails. I using SwiftMailer 5.1.0 and account on gmail, smtp port 465 and openssl is enable, but I have this error:
Serwer: smtp.gmail.com:465 ssl
From: BizIn - system mailowy <isystemnew.pcet#gmail.com>
To: test7771#test.pl
Mail debug: Connection could not be established with host smtp.gmail.com [ #0]
At my localhost everything is okey and mails are send. But on serwer I have error.
Localhost using PHP in version 5.4.31, but at server is 5.6.0.
The fix here solved it for me: https://github.com/swiftmailer/swiftmailer/issues/544
#if-joerch
if-joerch commented on Nov 3, 2014
If you are using PHP 5.6, the error does occur because of the "SSL
context options" used for the stream context in swiftmailer. IN PHP
5.6 verify_peer and verify_peer_name the default was set to TRUE, so PHP checks the SSL certificate. It is currently not possible to
disable it in swiftmailer using some options.
You could disable the SSL check by modifying the function
"_establishSocketConnection" in StreamBuffer.php. Add these lines
before stream_socket_client command:
$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;
It would be great if these options could be set without hacking the
code.

Perl IMAP connection to Exchange using Mail::IMAPClient?

I keep getting a NO LOGIN failed message when trying to connect to the Exchange server using Mail::IMAPClient. From what I've read everything should work. I've gotten it to connect to Gmail but trying to connect to MS Exchange is more difficult it seems like. What could be causing it to fail on authenticating?
use strict;
use warnings;
use Authen::NTLM;
use Mail::IMAPClient;
## Option variables
my $debug
my $authmech = "NTLM";
my $username = "useraccount";
my $password = "set by prompt;
## Settings for connecting to IMAP server
my $imap = Mail::IMAPClient->new(
Server => 'mail.server.domain',
User => $username,
Password => $password,
Port => 993,
Ssl => 1,
Authmechanism => $authmech,
Debug => 1
) or die "Cannot connect through IMAPClient: $#\n";
The out put from running the script.
~]./status_page_msg.pl -d
Logging in as : user_account
Started at Sat Nov 12 19:20:11 2011
Using Mail::IMAPClient version 3.29 on perl 5.008008
Connecting via IO::Socket::SSL to mail.server.domain:993 Timeout 600
Connected to mail.server.domain
Read: * OK The Microsoft Exchange IMAP4 service is ready - 'serverName'
Sending: 1 AUTHENTICATE NTLM
Sent 21 bytes
Read: +
Sending: TlRMTVNTUAABAAAAB6IAAAoACgAgAAAAAAAAAAoAAABlYW0tc3RhdHVz
Sent 58 bytes
Read: 1 NO AUTHENTICATE failed.
ERROR: 1 NO AUTHENTICATE failed. at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 3047
Mail::IMAPClient::authenticate('Mail::IMAPClient=HASH(0x1ac95440)', 'NTLM', 'undef') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 443
Mail::IMAPClient::login('Mail::IMAPClient=HASH(0x1ac95440)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 395
Mail::IMAPClient::Socket('Mail::IMAPClient=HASH(0x1ac95440)', 'IO::Socket::SSL=GLOB(0x1b43e110)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 351
Mail::IMAPClient::connect('Mail::IMAPClient=HASH(0x1ac95440)') called at /usr/lib/perl5/site_perl/5.8.8/Mail/IMAPClient.pm line 307
Mail::IMAPClient::new('Mail::IMAPClient', 'Server', 'mail.server.domain', 'User', 'user_account', 'Password', 'Correct', 'Port', 993, ...) called at ./status_page_msg.pl line 63
Cannot connect through IMAPClient: 1 NO AUTHENTICATE failed.
You should have said that it used to work, but stopped working when the server was upgraded to Exchange 2010.
A quick Google for "Exchange 2010 NTLM IMAP" turned up Discontinued Features from Exchange 2007 to Exchange 2010:
NTLM isn't supported for POP3 or IMAP4 client connectivity in Exchange 2010 RTM. Connections from POP3 or IMAP4 client programs using NTLM will fail. If you are running Exchange 2010 RTM, the recommended POP3 and IMAP4 setting alternatives to NTLM are:
Kerberos (GSSAPI)
Plain Text Authentication with SSL
If you are using Exchange 2010 RTM, to use NTLM, you must retain an Exchange 2003 or Exchange 2007 server in your Exchange 2010 organization.
Support for NTLM authentication for POP3 and IMAP4 connectivity has been brought back in Exchange 2010 SP1.
Since you're using SSL, you should be able to switch to plain text authentication (just delete Authmechanism). Or, get your sysadmins to install SP1.