Skip to content

Instantly share code, notes, and snippets.

View jebarsoba's full-sized avatar

Jorge Estanislao Barsoba jebarsoba

View GitHub Profile
public async Task Invoke(HttpContext context)
{
try
{
await this.next(context);
}
catch (Exception ex)
{
await HandleExceptionAsync(context, ex);
}
public class ExceptionLogEntry
{
public DateTime? Timestamp { get; set; }
public string User { get; set; }
public string RequestUri { get; set; }
public string RequestMethod { get; set; }
public string ExceptionType { get; set; }
public string ExceptionMessage { get; set; }
public string RequestIpAddress { get; set; }
public int RequestThreadId { get; set; }
public async Task Invoke(HttpContext context)
{
Stopwatch stopWatch = Stopwatch.StartNew();
LogEntry logEntry = new LogEntry
{
Timestamp = DateTime.Now
// Set the other request related LogEntry attributes...
};
public class LogEntry
{
public DateTime? Timestamp { get; set; }
public string User { get; set; }
public string RequestUri { get; set; }
public string RequestMethod { get; set; }
public string RequestIpAddress { get; set; }
public int RequestThreadId { get; set; }
public string RequestContentType { get; set; }
public string RequestContentBody { get; set; }
@jebarsoba
jebarsoba / solving-keystore-issues.txt
Created August 1, 2017 18:51
Solving missing certificate issue in SAP IdM
To solve the issue "unable to find valid certification path to requested target", I had to do the following:
1) Adding Success Factors cert to the keystore: C:\sapjvm_6\jre\lib\security>keytool -import -storepass changeit -file _.success factors.com.cer -keystore cacerts -alias _.successfactors.com
2) Replacing server JRE 6 "C:\sapjvm_6\jre\lib\security\cacerts" with local JRE 8 "C:\jdk-8u121\jre\lib\security\cacerts"
"keystore" (http://keystore-explorer.org/) is a tool that can also be used to open a cacerts file and import/export .cer files into/from it.
@jebarsoba
jebarsoba / telnet-smtp-check.txt
Created April 16, 2016 00:44
Telnet commands to check SMTP communication
telnet [smtp-server-name] [port-number]
HELO [source-host-name]
MAIL from: [from-mail-address]
RCPT to: [to-mail-address]
DATA
subject: this is a test message
sending a test message via telnet
.