Skip to content
Snippets Groups Projects
Commit d5ab7c02 authored by adrespi's avatar adrespi
Browse files

seguridad :)

parent e370bec1
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,10 @@
<list default="true" id="0c5e7f40-d6e0-4cdf-8175-c288dac24af5" name="Changes" comment="nombres de hosts">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/mp3files/destination/AmigaMia.mp3" beforeDir="false" afterPath="$PROJECT_DIR$/mp3files/destination/AmigaMia.mp3" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/media/Globals.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/media/Globals.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/ContinuousReadL.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit/ContinuousReadL.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/server/Launcher.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/server/Launcher.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/spotify/rmi/server/SpotifyServerImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/spotify/rmi/server/SpotifyServerImpl.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -38,43 +41,46 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"Application.Client.executor": "Run",
"Application.ContinuousReadL.executor": "Run",
"Application.Launcher.executor": "Run",
"Application.PlayList.executor": "Run",
"Application.PlayRandomSong.executor": "Run",
"Application.PlaySong.executor": "Run",
"Application.PrimerasOperaciones.executor": "Run",
"Application.SegundasOperaciones.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"git-widget-placeholder": "master",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "/home/ismael/IdeaProjects/practicasdis2/src/spotify/media",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "Modules",
"project.structure.proportion": "0.0",
"project.structure.side.proportion": "0.0",
"settings.editor.selected.configurable": "preferences.lookFeel",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;Application.Client.executor&quot;: &quot;Run&quot;,
&quot;Application.ContinuousReadL.executor&quot;: &quot;Run&quot;,
&quot;Application.ContinuousReadLSeguro.executor&quot;: &quot;Run&quot;,
&quot;Application.Launcher.executor&quot;: &quot;Run&quot;,
&quot;Application.LauncherSeguro.executor&quot;: &quot;Run&quot;,
&quot;Application.PlayList.executor&quot;: &quot;Run&quot;,
&quot;Application.PlayRandomSong.executor&quot;: &quot;Run&quot;,
&quot;Application.PlaySong.executor&quot;: &quot;Run&quot;,
&quot;Application.PrimerasOperaciones.executor&quot;: &quot;Run&quot;,
&quot;Application.SegundasOperaciones.executor&quot;: &quot;Run&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/adrian/IdeaProjects/practicasdis2/out/production/practicasdis2/spotify/rmi/server&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
&quot;project.structure.proportion&quot;: &quot;0.0&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.lookFeel&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/out/production/practicasdis2/spotify/rmi/server" />
<recent name="$PROJECT_DIR$/src/spotify/media" />
<recent name="$PROJECT_DIR$/src/spotify/rmi/client/stream/unit" />
<recent name="$PROJECT_DIR$/src/spotify" />
<recent name="$PROJECT_DIR$/src/sdis/spotify/client/unit" />
<recent name="$PROJECT_DIR$/src/sdis/spotify/client" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/out/production/practicasdis2/spotify/rmi/server" />
<recent name="$PROJECT_DIR$/covers" />
<recent name="$PROJECT_DIR$/mp3files/origin" />
</key>
......@@ -85,10 +91,51 @@
<recent name="sdis.utils" />
</key>
</component>
<component name="RunManager" selected="Application.ContinuousReadLSeguro">
<configuration name="ContinuousReadLSeguro" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="spotify.rmi.client.stream.unit.ContinuousReadL" />
<module name="practicasdis2" />
<option name="PROGRAM_PARAMETERS" value="-Djavax.net.ssl.trustStore=Client_Truststore.p12 -Djavax.net.ssl.trustStorePassword=clientepass -Dfile.encoding=UTF-8" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="spotify.rmi.client.stream.unit.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="LauncherSeguro" type="Application" factoryName="Application" temporary="true">
<option name="MAIN_CLASS_NAME" value="spotify.rmi.server.Launcher" />
<module name="practicasdis2" />
<option name="PROGRAM_PARAMETERS" value="-Djavax.net.ssl.keyStore=Server_Keystore.p12 \ -Djavax.net.ssl.keyStorePassword=servidorpass \ -Dfile.encoding=UTF-8 " />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="spotify.rmi.server.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<list>
<item itemvalue="Application.ContinuousReadLSeguro" />
<item itemvalue="Application.LauncherSeguro" />
</list>
<recent_temporary>
<list>
<item itemvalue="Application.ContinuousReadLSeguro" />
<item itemvalue="Application.LauncherSeguro" />
</list>
</recent_temporary>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="jdk-11.0.22-corretto-11.0.22-4caba194b151-bfa3237e" />
<option value="bundled-jdk-9f38398b9061-39b83d9b5494-intellij.indexing.shared.core-IU-241.15989.150" />
<option value="bundled-js-predefined-1d06a55b98c1-91d5c284f522-JavaScript-IU-241.15989.150" />
</set>
</attachedChunks>
</component>
......@@ -110,6 +157,8 @@
<workItem from="1716309405427" duration="3744000" />
<workItem from="1716376204050" duration="3565000" />
<workItem from="1716384955891" duration="7363000" />
<workItem from="1716395037453" duration="4774000" />
<workItem from="1716400743091" duration="445000" />
</task>
<task id="LOCAL-00001" summary="l">
<option name="closed" value="true" />
......
No preview for this file type
......@@ -23,8 +23,8 @@ public class Globals {
public static String log_stream = " [STREAM] Streaming to: ";
public static String log_stream_end = " [STREAM] Stream finished. Tx Bytes: ";
// Streaming paths
public static String server_host = "localHost";
public static String client_host = "localHost";
public static String server_host = "localhost";
public static String client_host = "localhost";
public static int server_port = 20099;
public static String path_origin = "./mp3files/origin/";
public static String path_destination = "./mp3files/destination/";
......
File added
......@@ -18,7 +18,10 @@ public class ContinuousReadL {
System.setProperty("java.rmi.server.hostname",Globals.client_host);
try {
Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
javax.rmi.ssl.SslRMIClientSocketFactory rmicsf = new javax.rmi.ssl.SslRMIClientSocketFactory();
java.rmi.registry.Registry reg = java.rmi.registry.LocateRegistry.getRegistry(Globals.server_host, 1099, rmicsf);
Spotify or = (Spotify) reg.lookup(Globals.remote_name);
//Spotify or = (Spotify) Naming.lookup("rmi://"+Globals.server_host+"/"+Globals.remote_name);
System.out.println(or.hello());
......
File added
......@@ -76,8 +76,13 @@ public class Launcher {
}
try {
SpotifyServerImpl oRemoto = new SpotifyServerImpl(mapa, datosLog, DIRECTORIO);
Registry registro = LocateRegistry.createRegistry(PUERTO);
javax.rmi.ssl.SslRMIClientSocketFactory rmicsf =
new javax.rmi.ssl.SslRMIClientSocketFactory();
javax.rmi.ssl.SslRMIServerSocketFactory rmissf =
new javax.rmi.ssl.SslRMIServerSocketFactory();
SpotifyServerImpl oRemoto = new SpotifyServerImpl(mapa, datosLog, DIRECTORIO, rmicsf, rmissf);
Registry registro = LocateRegistry.createRegistry(PUERTO, rmicsf, rmissf);
registro.rebind(Globals.remote_name, oRemoto);
System.err.println("Servidor preparado");
} catch (Exception e) {
......
File added
File added
......@@ -29,8 +29,8 @@ public class SpotifyServerImpl
private HashMap<String, Media> DIRECTORIO;
private SpotifyClient client;
public SpotifyServerImpl(MultiMap<String, String> mapa, ConcurrentHashMap<String, String> datosLog, HashMap<String, Media> DIRECTORIO) throws java.rmi.RemoteException {
super();
public SpotifyServerImpl(MultiMap<String, String> mapa, ConcurrentHashMap<String, String> datosLog, HashMap<String, Media> DIRECTORIO, java.rmi.server.RMIClientSocketFactory rmicsf, java.rmi.server.RMIServerSocketFactory rmissf) throws java.rmi.RemoteException {
super(0,rmicsf,rmissf);
this.mapa = mapa;
this.datosLog = datosLog;
this.DIRECTORIO = DIRECTORIO;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment