samedi 18 octobre 2014

How can i make my small web application SSL secured


Vote count:

0




I'm new to IT industry. I have small web application where i have login.html page. I'm able to start my web-application using maven and server used is tomcat.Command i'm using to start is mvn tomcat7:run and url using http://localhost:8080/login.html. It works perfectly. But i want to change my URL from http to https and when i access my URL i.e https://localhost:8080/login.html then it should pop-up with SSL security alert and i should accept it.


After searching on net i have done some work arounds but its not working out. What i have tried :- My HTML page :-



<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Login App</h1>
<div id="emptyDiv"></div>
<div id="description"></div>
<!--container start-->
<div id="container">
<div id="container_body" style="background-color:#BBD700;float:center;">
<!--Form start-->
<div id="form_name">
<div class="firstnameorlastname">
<form >
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<div id="errorBox"></div>
First Name : <input id="firstName" type="text" name="Name" value="" >
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
Last name : <input id="lastName" type="text" name="LastName" value="" >

</div>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<div id="email_form">
Email Id: <input style="position:right" type="text" name="Email" value="" >
</div>
<input id="sub_form" type="submit" value="Submit">
</form>
</div>
<!--form ends-->
</div>
</div>
<!--container ends-->
</body>
</html>


Web.xml



<pre><code><!DOCTYPE web-app PUBLIC <span style="color: red;">"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"</span> <span style="color: red;">"http://ift.tt/HeF78r"</span>>
<web-app>
<!-- <security-constraint>
<web-resource-collection>
<web-resource-name>SwapIntegrationApp</web-resource-name>
<url-pattern>/login.html</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

<security-constraint>
<web-resource-collection>
<web-resource-name>Non-SecureResource</web-resource-name>
<url-pattern>/login.html</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint> -->

<display-name>Login WebApp</display-name>
</web-app>
</span></code></pre>


Maven Plugin Used :-



<!-- Maven Tomcat Plugin -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>https://localhost:8080/manager/text</url>
<server>localhost</server>
<path>/</path>
<username>admin</username>
<password>aRfalah</password>

</configuration>
<executions>
<execution>
<id>tomcat7-run</id>
<goals>
<goal>run-war-only</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<fork>true</fork>

</configuration>
</execution>

<execution>
<id>tomcat7-shutdown</id>
<goals>
<goal>shutdown</goal>
</goals>
<phase>post-integration-test</phase>
</execution>
</executions>
</plugin>


asked 13 secs ago







How can i make my small web application SSL secured

Aucun commentaire:

Enregistrer un commentaire