@RequestHeader in Spring MVC

import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestHeader;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;@Controllerpublic class RequestHeaderExampleController{    @RequestMapping(value = "/example", method = RequestMethod.GET)    public String  getHello(@RequestHeader ("host") String hostName,            @RequestHeader ("Accept") String acceptType,            @RequestHeader ("Accept-Language") String acceptLang,            @RequestHeader ("Accept-Encoding") String acceptEnc,            @RequestHeader ("Cache-Control") String cacheCon,            @RequestHeader ("Cookie") String cookie,      ... [Read More]

using keystore & trust store in java

  add this code for run application that use  keystore option1 System.setProperty("javax.net.ssl.keyStore","/azizkhani/Java/pdf/EIA/keystore.jks");System.setProperty("javax.net.ssl.keyStorePassword", "pass");System.setProperty("javax.net.debug", "all");   option2   -Djavax.net.ssl.keyStore=/azizkhani/Java/pdf/EIA/keystore.jks -Djavax.net.ssl.keyStorePassword=pass;   [Read More]

https test using certificate & keystore

  package org.springframework.integration.samples.rest;import java.io.BufferedReader;import java.io.InputStream;import java.io.InputStreamReader;import java.net.MalformedURLException;import java.net.URL;import javax.net.ssl.TrustManager;import javax.net.ssl.X509TrustManager;public class HttpsTest {    public static void main(String[] args) {        System.setProperty("javax.net.ssl.keyStore","/azizkhani/keystore.jks");        System.setProperty("javax.net.ssl.keyStorePassword", "pass");        // full log for debugging        System.setProperty("javax.net.debug", "all");        try {            try {                javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(                        new... [Read More]

disable java check for subject alternative names in certificate

when i want to invoke https webservice by certificate(keystore.jks) . i get this exception  java.security.cert.CertificateException: No subject alternative names present ip of webservice is 192.168.1.10 but certificate is created for 192.168.1.20 java check this in client and throw this exception  i add host for 192.168.1.20  in my os and add... [Read More]