HTTP Client Manager $request->getStatusCode() == 200 return?

When I read this HTTP Client Manager docs on Drupal, I don’t understand why it returns the $ build when $ request->getStatusCode() == 200, is that supposed to be not equal 200? I also copy and pastes the code from Drupal docs.

public function posts($  limit, $  sort) {     $  build = [       '#theme' => 'mymodule_posts_list',       '#posts' => [],     ];      $  request = $  this->httpClient->request('GET', '', [       'limit' => $  limit,       'sort' => $  sort,     ]);      // This is the Part I don't understand.     if ($  request->getStatusCode() == 200) {       return $  build;     }      $  posts = $  request->getBody()->getContents();     foreach ($  posts as $  post) {       $  build['#posts'][] = [         'id' => $  post['id'],         'title' => $  post['title'],         'text' => $  post['text'],       ];     }     return $  build;   } 

Question regarding Client Side date/time and regional settings

I am working on an enterprise wiki site collection inside SP on-premises 2013. and inside the page layout i added this javascript, which get 2 date fields values from the current page (expirydate & modifieddate) + the current date/time:-

function showexpiry(){      var ctx = SP.ClientContext.get_current();     var web = ctx.get_web();     var list = web.get_lists().getById(_spPageContextInfo.pageListId);     var item = list.getItemById(_spPageContextInfo.pageItemId);      ctx.load(list);     ctx.load(item);      ctx.executeQueryAsync(            function(){               var expirydate = item.get_item('TDMExpireDate');             var expiredperiod = new Date(expirydate);             expiredperiod.setDate(expiredperiod.getDate()+1);                        var modifieddate = item.get_item('Modified');                         var currentdate = new Date();             //code goes here...             if (expirydate != null && modifieddate  < expirydate && currentdate > expiredperiod ) 

now i was afraid that since i am using JavaScript to do date comparison , to have different results on different PCs which use different regional settings and date/time format such as dd/mm/yyyy or mm/dd/yyyy.

Now the site collection has this regional settings:- enter image description here

which are compatible with the regional setting for my Pc and date/time format:- enter image description here

so i got the dates from my code in this compatible format expirydate = Tue Jun 11 2019 00:00:00 GMT+0100 (British Summer Time) & currentdate = Thu Jun 13 2019 00:54:15 GMT+0100 (British Summer Time).

my concerns were if i access the site on a PC which uses the US date format, to have my dates in an incompatible formats. but i have noted that even the date values for the site columns and the current date will be compatible, so when i changed the date/format for the PC to use mm/dd/yyyy instead of dd/mm/yyyy (and this format is different from the regional settings inside sharepoint site collection), all the returned dates got the new format (expirtdate + modifieddate + currentdate). so i got the values as follow
expirydate = Mon Jun 10 2019 16:00:00 GMT-0700 (Pacific Daylight Time) & currentdate = Wed Jun 12 2019 16:55:26 GMT-0700 (Pacific Daylight Time). for example the modified date shown inside the page will be 10/06/2019 16:56while the JavaScript will read it as shown in the popup:- enter image description here

My Question is can anyone advice how the JavaScript code, converted the expirtydate + the modifieddateto match the users’ PC settings and the currentdate automatically?

cert-manager : GRPC/HTTP2 with TLS issue – call from client with roots.pem not working

The certificate is generated thanks to letsencrypt in kubernetes with cert-manager. It is in the form of a k8s secret and contains:

Type:  Data ==== tls.crt:  1005 bytes tls.key:  1675 bytes ca.crt:   0 bytes 

From the client side, if I give tls.crt for the ssl credentials, the connection works fine.

If I give roots.pem or the letsencrypt intermediate CA, then I get this error:

E0612 16:11:33.693316575    8159] Handshake failed  with fatal error SSL_ERROR_SSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed. 

What should I do to not have to provide the public cert to the client?

Thank you for any help!

node.js app on ubuntu linux with postgresql on virtual box on windows client

I set up, ubuntu linux on virtual box. Then I installed postgresql and node.js So basically I made a clean installation and i want that ubuntu handles my requests. When i run node server.js , a Sequelize.js error occurred.

Unhandled rejection SequelizeConnetionRefusedError: connect ECONNREFUSED

PostgreSQL is listening on port 5432, and once i run node server.js,tables are created with no problem.

I think is a problem with my client, and I don’t know why.

postgres.conf listen_addresses=’*’.

pg_hba.conf host all all trust.

I have little bit experience with Linux Ubuntu and configuration So a big hug and thanks for who will help me

How do I extended the validity of a client certificate?

I have this script for creating a root and client certificate for azure point to site vpn connection.

I have extended the root certificate validity to 5 years but when I generate my client certificate it only had 1 year validity.

Here the powershell script I’ve used.


$  cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature ` -Subject "RootCert-AzureP2SVPN" -KeyExportPolicy Exportable ` -HashAlgorithm sha256 -KeyLength 2048 ` -CertStoreLocation "Cert:\CurrentUser\My" -KeyUsageProperty Sign -KeyUsage CertSign -NotAfter(Get-Date).AddYears(5) 


New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature ` -Subject "ClientCert-AzureP2SVPN" -KeyExportPolicy Exportable ` -HashAlgorithm sha256 -KeyLength 2048 ` -CertStoreLocation "Cert:\CurrentUser\My" ` -Signer $  cert -TextExtension @("{text}") 

invoke a URL Perl script silently, without changing URL visible to client

I’ve been fighting the Google canonical page algorithm bug for 2+ months. Following various forum advice and suggestions haven’t solved it yet, although for sure they’ve made our website better. One advice I’ve been given is to hide, or make silent, our use of a page generation Perl script (example here), and give Google indexing only “plain URLs” with no script, no page parameters, no file extensions, etc. I don’t know if that fixes it but anything is worth a try when Google indexing goes into lock mode and refuses to index your pages.

My question is: how to start with a URL and end up with the same URL, with Perl script processing in between? I thought about doing it with an .htaccess rewrite, which we already use, for example: –>

but then I would need to rewrite back, and that would be an .htaccess loop. Plus if the URL were given in the first place I would not want the first rewrite.

Any and all suggestions on how to solve this welcome.

TLS Handshake: no response to Client Hello from TLS1.0 Windows XP client [on hold]

First, I know TLS1.0 is bad, but I have no choice but to support it – we cannot control the client end, and not supporting a large percentage of clients would put us at a major competitive disadvantage for this project.

I’m not remotely expert when it comes to SSL/TLS/etc, but I think I have some idea how this is supposed to work.

I have written a service which is running on a windows 10 machine over https using a self-signed SSL Cert. This works fine provided (of course) any clients explicitly trust this Certificate or are configured to not validate the server cert. Ordinarily this will support TLS 1.1 & 1.2 but for the purposes of this test I’ve restricted it to 1.0 only

Some clients for this service are running on Windows XP (the specific one I have to test with is Windows XP Embedded SP2, but can’t state this is what all XP clients will use).

I’ve used NetMon to capture a network trace.

I believe it’s a cipher suite negotiation issue.

As a test I installed an old version of FireFox on the XP machine and used that to make a connection. This works ok but as I understand things FF uses its own TLS stack so obviously can agree on a cipher suite, but it does at least rule out any other networking things or issues with my service.

I’m using IISCrypto to view/amend related stuff on my windows 10 machine.

I’ve used NetMon to capture traces and can see Client Hello messages from these older clients, but no Server hello in response. I can see the client sends a list of (older) Cipher suites, the third of which is TLS_RSA_WITH_3DES_EDE_CBC_SHA, which is one I appear to have in my list

I’ve used IISCrypto to enable this cipher suite on my windows 10 machine and re-order the list such that it is at the top, but this has made no difference. It’s possible I added this to the list using IIS Crypto, but not sure at this point (been looking at this for several days)..

If I create a TLS 1.0-only client and run that on my machine locally it works fine.

My best guess is that one of the component parts of the cipher is not properly setup/existing… Can anyone suggest what I can change that may help?


Debian openvpn client systemd service

Just installed openvpn on Debian 9 looking for the right way to enable client at boot:

apt install openvpn 

This won’t work:

Error opening configuration file: /etc/openvpn/myclient


nano /etc/openvpn/client/myclient.ovpn systemctl status openvpn-client@myclient systemctl start openvpn-client@myclient   giu 10 11:23:11 gigi openvpn[15284]: Options error: In [CMD-LINE]:1: Error opening configuration file: myclient.conf giu 10 11:23:11 gigi openvpn[15284]: Use --help for more information. giu 10 11:23:11 gigi systemd[1]: openvpn-client@myclient.service: Main process exited, code=exited, status=1/FAILURE -- Subject: Unit process exited -- Defined-By: systemd 

Insteda with the configuration file name will work:

nano /etc/openvpn/client/myclient.conf  systemctl start openvpn-client@myclient 

but with “-” within the conf name it will fail.

This will work:

nano /etc/openvpn/client/myclient.conf systemctl status openvpn@myclient systemctl enable openvpn@myclient  ‚óŹ openvpn@myclient.service - OpenVPN tunnel for myclient    Loaded: loaded (/lib/systemd/system/openvpn-client@.service; enabled; vendor preset: enabled)    Active: inactive (dead) 

Didn’t find any documentation about it to see if should work in one way or the other.

Which way should be preferred openvpn/client/conf or openvpn/conf?