Flutter app show grey screen in release mode but works fine in debug mode Instance of ‘DiagnosticsProperty’

When you run your app in debug mode and when something goes wrong, you see the scary red error screen with logs. In release mode, you just see a grey screen. Now, when you ran your app in debug mode, at times there are some errors which are thrown but we mistakenly ignore them as … Read more

Simple Java HTTPS server

What I eventually used was this: try { // Set up the socket address InetSocketAddress address = new InetSocketAddress(InetAddress.getLocalHost(), config.getHttpsPort()); // Initialise the HTTPS server HttpsServer httpsServer = HttpsServer.create(address, 0); SSLContext sslContext = SSLContext.getInstance(“TLS”); // Initialise the keystore char[] password = “simulator”.toCharArray(); KeyStore ks = KeyStore.getInstance(“JKS”); FileInputStream fis = new FileInputStream(“lig.keystore”); ks.load(fis, password); // Set … Read more

how to Capture https with fiddler, in java

Create a keystore containing the Fiddler certificate. Use this keystore as the truststore for the JVM along with the proxy settings. Here’s how to do that: Export Fiddler’s root certificate Tools -> Fiddler Options… -> HTTPS -> Export Root Certificate to Desktop Create a keystore with this certificate Open command line as administrator (keytool doesn’t … Read more

asp.net c# redirecting from http to https

I’d do a !Request.IsLocal as well to make sure that I’m not debugging, though if you’re using a real instance of IIS with a cert applied when debugging that shouldn’t be an issue. if (!Request.IsLocal && !Request.IsSecureConnection) { string redirectUrl = Request.Url.ToString().Replace(“http:”, “https:”); Response.Redirect(redirectUrl, false); HttpContext.ApplicationInstance.CompleteRequest(); } Note: This answer assumes an MVC context within … Read more

Access Https Rest Service using Spring RestTemplate

KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(new FileInputStream(new File(keyStoreFile)), keyStorePassword.toCharArray()); SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory( new SSLContextBuilder() .loadTrustMaterial(null, new TrustSelfSignedStrategy()) .loadKeyMaterial(keyStore, keyStorePassword.toCharArray()) .build(), NoopHostnameVerifier.INSTANCE); HttpClient httpClient = HttpClients.custom().setSSLSocketFactory( socketFactory).build(); ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory( httpClient); RestTemplate restTemplate = new RestTemplate(requestFactory); MyRecord record = restTemplate.getForObject(uri, MyRecord.class); LOG.debug(record.toString());

Google Web Fonts on HTTPS pages on Chrome

Create a schema agnostic url Change http://fonts.google… to //fonts.google… Drop the http: or https: from the front, the browser will use whichever schema you’re currently using on the site. You may request resources using https from http, but not the other way round. An alternative to the above solution (and probably best practice) is to … Read more

Visual Studio 2017 Enable SSL

Ports are locked down in IIS Express so that it doesn’t have to be run as Administrator… Valid Ports are 44300 – 44399 Check out the Dev Community article https://developercommunity.visualstudio.com/content/problem/39430/changing-port-number-in-a-web-project-does-not-imm.html You can edit launchSettings.json, but the ssl ports must fall in this range.