Skip to main content

Posts

Showing posts from June, 2018

GOLD : api basic authentication

Use Invoke-WebRequest with a username and password for basic authentication on the GitHub API With cURL, we can pass a username with an HTTP web request as follows: $ curl -u <your_username> https://api.github.com/user The -u flag accepts a username for authentication, and then cURL will request the password. The cURL example is for Basic authentication with the GitHub Api. How do we similarly pass a username and password along with Invoke-WebRequest? The ultimate goal is to user PowerShell with Basic authentication in the GitHub API. Edit (This is What Worked) Notes are from Wikipedia on Basic Auth from the Client Side. Combine the username and password into a single string username:password $user = "shaunluttin" $pass = "super-strong-alpha-numeric-symbolic-long-password" $pair = "${user}:${pass}" Encode the string to the RFC2045-MIME variant of Base64, except not limited to 76 char/line. $bytes = [System.Text.Encoding]::ASCII.GetBytes($pair) $base6

PowerShell : Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.

Problem: PS C:\My_Files\JiraSMS.ps1 Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send. At C:\My_Files\JiraSMS.ps1:42 char:17 +     $response = Invoke-RestMethod -Uri $uri -Headers $headers +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException     + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand Resolution: It's a TLS 1.2 problem, just follow the procedure on =>  https://baliwme.blogspot.com/2018/06/biztalk-configuring-biztalk-2013-server.html Do not forgot to RESTART your PC/Server once done. :)

Biztalk : Calling http://www.q88.com/es/api.aspx?op=ImportOfficerMatrix thru send port

Calling Q88 Soap/Api: Send Port Name : Q88_Step03B - spPushUpdatesToq88_CallQ88Webservice Type: WCF-WebHttp URI: http://www.q88.com/es/api.aspx Send handler: Send Send pipeline: PassThruTransmit Receive pipeline: XMLReceive  Configure... General: - Address: http://www.q88.com/es/api.aspx - HTTP Method and URL Mapping: POST Binding: - All timeout set to 00:10:00 Security: - Security mode: None Messages: - Outbound HTTP Headers: Content-Type: text/xml SoapAction: " http://heidenreich.net/ws/ImportOfficerMatrix "

Biztalk - Configuring Biztalk 2013 Server for TLS 1.2

Reference: https://social.technet.microsoft.com/wiki/contents/articles/51476.biztalk-configure-tls-1-2-on-biztalk-server.aspx Steps: - Windows Start - Type regedit and enter - Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols - Create new Key => TLS 1.2 - Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2 - Create new Key => Client - Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Client - Create New > DWORD (32-bit) value > DisabledByDefault = dword:0 - Create New > DWORD (32-bit) value > Enabled  = dword:1 - Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2 - Create new Key => Server - Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\Server - Create New > DWORD (32-bit) value > DisabledByDefault = dword:0 - Create New